Skip to main content

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

Metadata

Release files for pylint-sqlalchemy2 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylint-sqlalchemy2 0.2.0
File Size Uploaded
pylint_sqlalchemy2-0.2.0.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pylint-sqlalchemy2 0.2.0
File Interpreter ABI Platform
pylint_sqlalchemy2-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.6 kB

Release files / pylint_sqlalchemy2-0.2.0.tar.gz

Download URL pylint_sqlalchemy2-0.2.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6773c79db256deda3ea7a7cce9a16da06093aa213a60b52d271045100c991de5
BLAKE2b-256 checksum
How to use checksums
77a0c5460ee8f21434f90435df26c8172726dd4bb0d22f9256013ad0d4cb8e39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / pylint_sqlalchemy2-0.2.0-py3-none-any.whl

Download URL pylint_sqlalchemy2-0.2.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e29affad3454d00ad88dfc55aa1211681ee5edfdca661e26f5ab33c977ae8a02
BLAKE2b-256 checksum
How to use checksums
bc777926bf3d4da1a8ca11f8db693dc20c7b4bac749eb31b4bfb429cf074575a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page