1from typing import List 2 3from sqlalchemy import Column 4from sqlalchemy import ForeignKey 5from sqlalchemy import Integer 6from sqlalchemy.ext.declarative import declarative_base 7from sqlalchemy.orm import relationship 8 9Base = declarative_base() 10 11 12class B(Base): 13 __tablename__ = "b" 14 id = Column(Integer, primary_key=True) 15 16 # EXPECTED: Expected Python collection type for collection_class parameter # noqa 17 as_: List["A"] = relationship("A", collection_class=None) 18 19 # EXPECTED: Can't infer type from ORM mapped expression assigned to attribute 'another_as_'; # noqa 20 another_as_ = relationship("A", uselist=True) 21 22 23class A(Base): 24 __tablename__ = "a" 25 26 id = Column(Integer, primary_key=True) 27 b_id: int = Column(ForeignKey("b.id")) 28 29 # EXPECTED: Sending uselist=False and collection_class at the same time does not make sense # noqa 30 b: B = relationship(B, uselist=False, collection_class=set) 31