Skip to content

Commit

Permalink
Specify that id may be int or UUID; reinsert Any type into namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Nov 14, 2023
1 parent 4240e3d commit 8be7ed9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion funnel/models/reorder_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ReorderProtoMixin:
#: Subclasses must have a created_at column
created_at: Mapped[datetime]
#: Subclass must have a primary key that is int or uuid
id: Mapped[int] # noqa: A001
id: Mapped[int | UUID] # noqa: A001
#: Subclass must declare a parent_id synonym to the parent model fkey column
parent_id: Mapped[int | UUID]
#: Subclass must declare a seq column or synonym, holding a sequence id. It
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def pytest_runtest_call(item: pytest.Function) -> None:
try:
annotations = get_type_hints(
item.obj,
# globalns=item.obj.__globals__,
# localns={'Any': Any}, # pytest-bdd appears to insert an `Any` annotation
globalns=item.obj.__globals__,
localns={'Any': Any}, # pytest-bdd appears to insert an `Any` annotation
)
except TypeError:
# get_type_hints may fail on Python <3.10 because pytest-bdd appears to have
Expand Down

0 comments on commit 8be7ed9

Please sign in to comment.