Skip to content

Commit

Permalink
fix(typing): fix typing of id_attribute fields (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
nightblure authored Dec 19, 2024
1 parent a3164de commit 488711e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions advanced_alchemy/repository/_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
class SQLAlchemyAsyncRepositoryProtocol(FilterableRepositoryProtocol[ModelT], Protocol[ModelT]):
"""Base Protocol"""

id_attribute: Any
id_attribute: str
match_fields: list[str] | str | None = None
statement: Select[tuple[ModelT]]
session: AsyncSession | async_scoped_session[AsyncSession]
Expand Down Expand Up @@ -402,7 +402,7 @@ class SQLAlchemyAsyncRepository(SQLAlchemyAsyncRepositoryProtocol[ModelT], Filte
:class:`~advanced_alchemy.repository._util.FilterableRepository`
"""

id_attribute: Any = "id"
id_attribute: str = "id"
"""Name of the unique identifier for the model."""
loader_options: LoadSpec | None = None
"""Default loader options for the repository."""
Expand Down
4 changes: 2 additions & 2 deletions advanced_alchemy/repository/_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
class SQLAlchemySyncRepositoryProtocol(FilterableRepositoryProtocol[ModelT], Protocol[ModelT]):
"""Base Protocol"""

id_attribute: Any
id_attribute: str
match_fields: list[str] | str | None = None
statement: Select[tuple[ModelT]]
session: Session | scoped_session[Session]
Expand Down Expand Up @@ -403,7 +403,7 @@ class SQLAlchemySyncRepository(SQLAlchemySyncRepositoryProtocol[ModelT], Filtera
:class:`~advanced_alchemy.repository._util.FilterableRepository`
"""

id_attribute: Any = "id"
id_attribute: str = "id"
"""Name of the unique identifier for the model."""
loader_options: LoadSpec | None = None
"""Default loader options for the repository."""
Expand Down

0 comments on commit 488711e

Please sign in to comment.