dropbox / dropbox/sqlalchemy-stubs

sql-alchemy 1.4 - using is_not on column leads to mypy warning, while using isnot does not lead to the warning

Open
#244 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
583
Forks
96
PR merge metrics
No merged PRs in 30d

Description

In the sqlalchemy version 1.4, the method isnot was renamed to is_not, and the old method was left for backward compatibility.

(see https://docs.sqlalchemy.org/en/14/core/sqlelement.html#sqlalchemy.sql.expression.ColumnOperators.is_not)

However, if one try to use is_not on the column expression

(something like:
```
...
.where(and_(pch_alias.c.New_Id.is_not(None))))
```

)
then one gets following warning in mypy:

` error: "Column[Any]" has no attribute "is_not"
`
However, if one is using older isnot construct, then mypy produces no warning.

As is_not now is a recommended method, I think stubs should function with it without warnings.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.