Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dantownsend committed Oct 4, 2024
1 parent af3f3ef commit e62af83
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions piccolo/columns/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ForeignKeyMeta(t.Generic[ReferencedTable]):
proxy_columns: t.List[Column] = field(default_factory=list)

@property
def resolved_references(self) -> t.Type[ReferencedTable]:
def resolved_references(self) -> t.Type[Table]:
"""
Evaluates the ``references`` attribute if it's a ``LazyTableReference``,
raising a ``ValueError`` if it fails, otherwise returns a ``Table``
Expand All @@ -98,7 +98,7 @@ def resolved_references(self) -> t.Type[ReferencedTable]:
from piccolo.table import Table

if isinstance(self.references, LazyTableReference):
return t.cast(t.Type[ReferencedTable], self.references.resolve())
return self.references.resolve()
elif inspect.isclass(self.references) and issubclass(
self.references, Table
):
Expand Down
2 changes: 1 addition & 1 deletion piccolo/columns/column_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@ class Band(Table):
""" # noqa: E501

_foreign_key_meta: ForeignKeyMeta[ReferencedTable]
_foreign_key_meta: ForeignKeyMeta

@property
def column_type(self):
Expand Down
5 changes: 4 additions & 1 deletion piccolo/query/methods/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ async def run(
node: t.Optional[str] = None,
in_pool: bool = True,
) -> t.Optional[ReferencedTable]:
references = self.foreign_key._foreign_key_meta.resolved_references
references = t.cast(
t.Type[ReferencedTable],
self.foreign_key._foreign_key_meta.resolved_references,
)

data = (
await self.row.__class__.select(
Expand Down

0 comments on commit e62af83

Please sign in to comment.