sqlalchemy-stubs icon indicating copy to clipboard operation
sqlalchemy-stubs copied to clipboard

Mypy plugin and stubs for SQLAlchemy

Results 96 sqlalchemy-stubs issues
Sort by recently updated
recently updated
newest added

I have an SQLAlchemy model that makes use of the `Enum` column type. When accessing the field of an instance of this model, mypy believes that the type of the...

enhancement
priority-normal
topic-stubs

mypy can run in a different virtual environment to the code it is checking. I think sqlalchemy-stubs should be separated into separate plugin and stubs packages so that the stubs...

I maintain a "realworld example app" for Pyramid, a popular Python Web framework. The example app uses SQLAlchemy. Recently I added `sqlalchemy-stubs` to the project to showcase how to do...

SQLAlchemy allows defining column defaults with a callable getting the insert/update context as an argument ([doc](https://docs.sqlalchemy.org/en/13/core/defaults.html?highlight=column%20default%20callable#context-sensitive-default-functions)), e.g: ```python def get_default(context): return context.get_current_parameters()['name'] + 'whatever' class MyModel(Base): __tablename__ = 'my_model' id...

priority-normal
topic-stubs

Hi, I'm getting a mypy error every time I want to create a model attribute from a JSON column. My mypy config uses the `sqlmypy` plugin. Without using this plugin,...

`RowProxy.__getitem__()`, works [by looking up elements either on its own `_keymap` or on `_parent.keys`](https://github.com/zzzeek/sqlalchemy/blob/2734439fff953a7bb8aecdedb5f851441b5122e9/lib/sqlalchemy/engine/result.py#L94-L114). In the case of a `select` statement, the resulting RowProxy object will have keys matching the...

Basic reproduce ``` Class Model: @hybrid_property def property(self): pass @property.setter # error appears on this line def property(self): pass ```

I may be missing something, but apparently the following code: ```py select([text('*')]) ``` Gives this type error: `List item 0 has incompatible type "TextClause"; expected "Union[ColumnElement[Any], FromClause, int]"` I would...

I'm trying to upgrade to mypy==0.740 which now apparently has a new semantic analyzer. It seems to trigger a lot of errors that weren't there using 0.710. The mypy docs...

bug
priority-high
topic-plugins

I do not know if #82 will fix the issue but I have the following problem with mypy. I use `typing` in order to simplify coding. ```python repositories: Set['Repository'] =...

enhancement
priority-normal
topic-plugins