Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make the typehint of `SQLAlchemy.relationship` consistent with `sqlalchemy.orm.relationship`.
  • Loading branch information
cainmagi committed Mar 26, 2024
1 parent fec440f commit 281dadf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/flask_sqlalchemy/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,9 +952,7 @@ def _set_rel_query(self, kwargs: dict[str, t.Any]) -> None:

backref[1].setdefault("query_class", self.Query)

def relationship(
self, *args: t.Any, **kwargs: t.Any
) -> sa_orm.RelationshipProperty[t.Any]:
def relationship(self, *args: t.Any, **kwargs: t.Any) -> sa_orm.Relationship[t.Any]:
"""A :func:`sqlalchemy.orm.relationship` that applies this extension's
:attr:`Query` class for dynamic relationships and backrefs.
Expand All @@ -976,9 +974,7 @@ def dynamic_loader(
self._set_rel_query(kwargs)
return sa_orm.dynamic_loader(argument, **kwargs)

def _relation(
self, *args: t.Any, **kwargs: t.Any
) -> sa_orm.RelationshipProperty[t.Any]:
def _relation(self, *args: t.Any, **kwargs: t.Any) -> sa_orm.Relationship[t.Any]:
"""A :func:`sqlalchemy.orm.relationship` that applies this extension's
:attr:`Query` class for dynamic relationships and backrefs.
Expand Down

0 comments on commit 281dadf

Please sign in to comment.