module documentation

Undocumented

Function scan_declarative_assignments_and_apply_types Undocumented
Function _scan_declarative_assignment_stmt Extract mapping information from an assignment statement in a declarative class.
Function _scan_declarative_decorator_stmt Extract mapping information from a @declared_attr in a declarative class.
Function _scan_for_mapped_bases Given a class, iterate through its superclass hierarchy to find all other classes that are considered as ORM-significant.
Function _scan_symbol_table_entry Extract mapping information from a SymbolTableNode that's in the type.names dictionary.
def scan_declarative_assignments_and_apply_types(cls: ClassDef, api: SemanticAnalyzerPluginInterface, is_mixin_scan: bool = False) -> Optional[List[util.SQLAlchemyAttribute]]: (source)

Undocumented

def _scan_declarative_assignment_stmt(cls: ClassDef, api: SemanticAnalyzerPluginInterface, stmt: AssignmentStmt, attributes: List[util.SQLAlchemyAttribute]): (source)

Extract mapping information from an assignment statement in a declarative class.

def _scan_declarative_decorator_stmt(cls: ClassDef, api: SemanticAnalyzerPluginInterface, stmt: Decorator, attributes: List[util.SQLAlchemyAttribute]): (source)

Extract mapping information from a @declared_attr in a declarative class. E.g.:: @reg.mapped class MyClass: # ... @declared_attr def updated_at(cls) -> Column[DateTime]: return Column(DateTime) Will resolve in mypy as:: @reg.mapped class MyClass: # ... updated_at: Mapped[Optional[datetime.datetime]]

def _scan_for_mapped_bases(cls: ClassDef, api: SemanticAnalyzerPluginInterface): (source)

Given a class, iterate through its superclass hierarchy to find all other classes that are considered as ORM-significant. Locates non-mapped mixins and scans them for mapped attributes to be applied to subclasses.

def _scan_symbol_table_entry(cls: ClassDef, api: SemanticAnalyzerPluginInterface, name: str, value: SymbolTableNode, attributes: List[util.SQLAlchemyAttribute]): (source)

Extract mapping information from a SymbolTableNode that's in the type.names dictionary.