Skip to content

Commit

Permalink
expand EntityID type
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Nov 17, 2024
1 parent 1c02043 commit 202c47d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lenskit/lenskit/data/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def create(cls, data: QueryInput) -> RecQuery:
assert_never(f"invalid type {type(data)}")


QueryInput: TypeAlias = RecQuery | EntityId | ItemList | np.integer | None
QueryInput: TypeAlias = RecQuery | EntityId | ItemList | None
"""
Types that can be converted to a query by :meth:`RecQuery.create`.
"""
2 changes: 1 addition & 1 deletion lenskit/lenskit/data/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
FeedbackType: TypeAlias = Literal["explicit", "implicit"]
"Types of feedback supported."

EntityId: TypeAlias = int | str | bytes
EntityId: TypeAlias = int | str | bytes | np.integer[Any] | np.string_
"Allowable entity identifier types."
NPEntityId: TypeAlias = np.integer[Any] | np.str_ | np.bytes_ | np.object_
"Allowable entity identifier types (NumPy version)"
Expand Down

0 comments on commit 202c47d

Please sign in to comment.