From 202c47d77d45de2a97d9321649c73058e0212cb4 Mon Sep 17 00:00:00 2001 From: Michael Ekstrand Date: Sun, 17 Nov 2024 14:05:22 -0500 Subject: [PATCH] expand EntityID type --- lenskit/lenskit/data/query.py | 2 +- lenskit/lenskit/data/types.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lenskit/lenskit/data/query.py b/lenskit/lenskit/data/query.py index a3685880c..c37fc80f1 100644 --- a/lenskit/lenskit/data/query.py +++ b/lenskit/lenskit/data/query.py @@ -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`. """ diff --git a/lenskit/lenskit/data/types.py b/lenskit/lenskit/data/types.py index a9f0824f2..6bcb2192e 100644 --- a/lenskit/lenskit/data/types.py +++ b/lenskit/lenskit/data/types.py @@ -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)"