sqlalchemy2-stubs
sqlalchemy2-stubs copied to clipboard
PEP-484 typing stubs for SQLAlchemy 1.4
re: #170 this worked for sqlalchemy-stubs, but does not seem to work here POC from https://github.com/dropbox/sqlalchemy-stubs/issues/98#issuecomment-781794732 ```py from typing import Any from typing import Callable from typing import Generic from...
**Describe the bug** Receiving an error when using `@declared_attr` decorator on `__tablenane__` class method. **Expected behavior** Not receiving an error. **To Reproduce** ```py from uuid import UUID, uuid4 from sqlalchemy...
tracked by https://github.com/sqlalchemy/sqlalchemy/issues/6955
**The following code runs fine without any mypy error** ``` python # file_type.py from enum import Enum from sqlalchemy.dialects.postgresql import ENUM class FileType(str, Enum): CSV = "CSV" XLSX = "XLSX"...
**Describe the bug** If a ORM class is created inside a function, mypy fails. As soon as the class is outside of a function, it works fine **Expected behavior** No...
**Describe the bug** if `Float(asdecimal=False)` (`asdecimal=False` is also the default behaviour for `Float`) is used as the type of a mapped column, the corresponding python type will be specified as...
**Describe the bug** Using hybrid_property leads to several errors - redefinition of methods - incompatible assignment types **Expected behavior** No errors are returned **To Reproduce** ```py from sqlalchemy import Column,...
**Is your feature request related to a problem? Please describe.** Currently [https://github.com/dropbox/sqlalchemy-stubs](sqlalchemy-stubs) allows specifying a type on a query eg `Query[MyModel]` whereas doing that in this library yields: `error: "Query"...
**Describe the bug** The type attribute of ColumnElement can get a class (at least in 1.4), but also an instance. This fails in mypy. I'm not quite sure how to...
**Describe the bug** Following the mypy support instructions [here](https://docs.sqlalchemy.org/en/14/orm/extensions/mypy.html#combining-with-dataclasses-or-other-type-sensitive-attribute-systems) and trying variations from [here](https://docs.sqlalchemy.org/en/14/orm/mapping_styles.html#example-two-dataclasses-with-declarative-table), I cannot find a way to get type checking to work for both the fields as...