Closed Dreamsorcerer closed 1 year ago
Seems that a forward ref is triggering F821, unless I'm missing something obvious.
Code:
class TestMany(base): # type: ignore[misc,valid-type] __tablename__ = "many" id: Mapped[int] = mapped_column(primary_key=True) ones: Mapped[list["TestOne"]] = relationship() # F821 undefined name 'TestOne' class TestOne(base): # type: ignore[misc,valid-type] __tablename__ = "one" id: Mapped[int] = mapped_column(primary_key=True) many_id: Mapped[int] = mapped_column(sa.ForeignKey(TestMany.id))
Run through pre-commit with flake8==6.0.0: https://github.com/aio-libs/aiohttp-admin/blob/relationships/.pre-commit-config.yaml#L41 https://github.com/aio-libs/aiohttp-admin/actions/runs/4377267582/jobs/7660514842
there's a dupe, try the latest on main
Seems that a forward ref is triggering F821, unless I'm missing something obvious.
Code:
Run through pre-commit with flake8==6.0.0: https://github.com/aio-libs/aiohttp-admin/blob/relationships/.pre-commit-config.yaml#L41 https://github.com/aio-libs/aiohttp-admin/actions/runs/4377267582/jobs/7660514842