Skip to main content

Pylint plugin for SQLAlchemy 2.x compatibility - fixes false positives for func.count(), func.sum(), etc.

Project description

pylint-sqlalchemy2

A Pylint plugin for SQLAlchemy 2.x compatibility. Install and forget!

Fixes false positive errors when using Pylint with SQLAlchemy, particularly for dynamically generated SQL functions like func.count(), func.sum(), func.max(), etc.

Installation

pip install pylint-sqlalchemy2

That's it! The plugin activates automatically. No configuration needed.

What it fixes

E1102: not-callable for func.*

SQLAlchemy's func object dynamically generates SQL function calls. Pylint cannot analyze this and reports false positives:

from sqlalchemy import func, select

# Without this plugin, pylint reports:
# E1102: func.count is not callable (not-callable)
query = select(func.count()).select_from(User)

This plugin teaches Pylint that func.count(), func.sum(), func.max(), and all other func.* attributes are callable.

How it works

The plugin uses a .pth file to automatically register Astroid transforms when Python starts. This means it works without any configuration - just install and run pylint as usual.

Alternative usage

If you prefer explicit configuration, you can also use:

Command line:

pylint --load-plugins=pylint_sqlalchemy2 your_code.py

pylintrc or pyproject.toml:

[MASTER]
load-plugins=pylint_sqlalchemy2

Compatibility

  • Python 3.9+
  • Pylint 3.0+
  • Astroid 3.0+
  • SQLAlchemy 1.4+ / 2.x

Why not pylint-sqlalchemy?

The original pylint-sqlalchemy package is deprecated and doesn't handle func.* callable issues. This plugin is a modern replacement with automatic activation.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylint_sqlalchemy2-0.2.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylint_sqlalchemy2-0.2.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file pylint_sqlalchemy2-0.2.0.tar.gz.

File metadata

  • Download URL: pylint_sqlalchemy2-0.2.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pylint_sqlalchemy2-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6773c79db256deda3ea7a7cce9a16da06093aa213a60b52d271045100c991de5
MD5 abf822acbe784d6b7866a208f052f7c8
BLAKE2b-256 77a0c5460ee8f21434f90435df26c8172726dd4bb0d22f9256013ad0d4cb8e39

See more details on using hashes here.

File details

Details for the file pylint_sqlalchemy2-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pylint_sqlalchemy2-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e29affad3454d00ad88dfc55aa1211681ee5edfdca661e26f5ab33c977ae8a02
MD5 92b898a89548b99cf5bb14875e7056fd
BLAKE2b-256 bc777926bf3d4da1a8ca11f8db693dc20c7b4bac749eb31b4bfb429cf074575a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page