PyPI / sqlalchemy / 2.1.6
sqlalchemy 2.1.6
- Source
- https://github.com/sqlalchemy/sqlalchemy
- Artifact scanned
sqlalchemy-2.1.6-py3-none-any.whl- Compared with
sqlalchemy-2.1.5-py3-none-any.whl(0 signals introduced since)- Files
- 260 scanned, 8 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 28 info
- Scan time
- 19.6 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 24 of 24 warn and critical signals; 24 demoted to info.
- Disclude version
- 4.3.0
- Scanned (UTC)
- 2026-10-23 03:30
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
= . =likely benign Loads a SQLAlchemy dialect module by name from the URL scheme.Reasoning
The dialect name comes from the URL scheme parsed by SQLAlchemy and is used to load a bundled dialect package under sqlalchemy.dialects. This is the documented plugin-loading mechanism, and the ImportError handling is ordinary.
-
= ..likely benign Imports a MariaDB driver submodule chosen by driver name.Reasoning
The driver name selects one of the bundled MySQL/MariaDB driver submodules. The namespace is fixed to the sqlalchemy package, so this is ordinary dialect dispatch.
-
= ..likely benign Imports the driver's constants.CLIENT module to read client flags.Reasoning
The module is the DBAPI's own name plus a fixed suffix, used to fetch client flag constants. This is a standard way to locate a driver's constants module.
-
= ..likely benign Imports the MySQLdb constants.CLIENT module to read client flags.Reasoning
Same pattern as the MariaDB connector: the DBAPI's own module name plus a fixed suffix to read CLIENT flags. Nothing here reaches outside the driver package.
-
passlikely benign Optionally imports a dialect's provision submodule, ignoring ImportError.Reasoning
Imports an optional provisioning helper package for a dialect, and ImportError is suppressed. This is test-support plumbing with no sign of malicious intent.
-
# establish pickle capability by adding it to this module =likely benign Registers a generated event class in module globals to support pickling.Reasoning
Assigns the class into module globals so it can be pickled, a documented technique for making dynamically created classes picklable. It does not execute anything.
-
=likely benign Evaluates declarative string expressions for relationship arguments.Reasoning
eval is applied to string expressions from mapper configuration such as relationship primaryjoin strings, with an explicit namespace. This is a known and intentional feature of declarative configuration, and the input is developer-supplied model code.
-
) =likely benign Generates and registers an Annotated class variant in module globals.Reasoning
Creates an Annotated<ClassName> class and stores it in globals, derived from a class already in the codebase. This is internal class generation with no external input.
-
= =likely benign Instantiates a coercion implementation class looked up by name in globals.Reasoning
Looks up a coercion implementation class by name from a fixed set of module-defined classes. The lookup is internal and does not come from untrusted input.
-
= =likely benign Executes internally generated code to rebuild closure cells for lambda caching.Reasoning
exec runs generated code that builds closure cells for SQL lambda caching. The code is produced by SQLAlchemy from its own templates, and the values are the lambda's captured closure variables, not external input.
-
= yieldlikely benign Imports a dialect module by name in the test engine helper.Reasoning
Imports a dialect module by name for the test engine helper. The name is a test parameter, and the code is test-only.
-
= . = =likely benign Uses the caller's stack frame to resolve a test-fixture directory.Reasoning
Inspects the caller's file path to locate test fixture files for mypy checks. This is a common test-suite pattern with no network, exec, or persistence behavior.
-
# late = =likely benign Imports a test module from a dotted name in the pytest plugin.Reasoning
Imports a test module from a dotted name taken from the test configuration. The code is pytest plugin plumbing with no external input path to it.
-
# in format_argpsec_plus() returnlikely benign Executes generated source to build a test function with a matching signature.Reasoning
exec compiles a generated function signature for test argument handling, which is the standard approach used to preserve argspecs. The code is produced internally.
-
= passlikely benign Reads the caller's module name from the stack frame in a test schema helper.Reasoning
Reads the caller's module name from the frame to set a table's schema module. This is a benign introspection pattern in test helpers.
-
, , , =, -
, =, ) -
= = -
= = -
= =likely benign Compiles and executes generated function source to create a decorated wrapper.Reasoning
Compiles and execs generated function source. The filename is registered in linecache for tracebacks, and the code comes from SQLAlchemy's own decorator generation, which is a standard metaprogramming technique.
-
=likely benign exec of generated function source in SQLAlchemy's decorator helper.Reasoning
SQLAlchemy's langhelpers uses exec to generate function bodies from templated source (decorator generation, self-compiled wrappers), then pulls the named function out of env. This is a known, documented metaprogramming pattern in the library; the code is generated internally rather than fetched from outside.
-
= =likely benign Deferred module import helper that imports a dotted path and walks attributes.Reasoning
Lazy-loading a module by dotted path via __import__ followed by getattr traversal is a standard deferred-import idiom (e.g. the dependency-loading helper for optional modules). The modulepath comes from library-internal constants, not untrusted input or network data.
-
= # being called from less than 3 (or given) stacklevels, weird,likely benign Call-stack frame lookup used to find the caller for warning attribution.Reasoning
sys._getframe with a stacklevel is used to determine the caller's module for warnings/deprecation messages, a common legitimate pattern. The 'anti-analysis' shape is a heuristic match only; the snippet shows no evasion or hiding behavior.
-
= returnlikely benign exec used to build a compatibility function returned as env['set'].Reasoning
Exec of a generated code string with a copied locals dict to return a constructed function (the 'set' builtin shadowing pattern) is an internal code-generation idiom used in SQLAlchemy for Python-version compatibility shims. No external input or obfuscation is evident.
-
) and not in : = =likely benign Lazy import of a named module cached into the module namespace on first attribute access.Reasoning
The preloaded module implements lazy module attribute loading: it imports a named module on first access and caches it in __dict__ and globals. This is a known, legitimate lazy-import design in SQLAlchemy.
-
= =likely benign Caches lazily imported module into globals and instance dict.Reasoning
Caching the imported module via globals() is part of the same lazy-loading mechanism; reaching by name through globals is ordinary Python for module-level caching and carries no malicious indication.
-
= =likely benign eval used to resolve string type annotations against a namespace.Reasoning
eval of type annotation strings with class and module namespaces is how typing.get_type_hints-style resolution works; SQLAlchemy uses it to resolve forward-reference annotations from its own source. The input is annotation text, not attacker-controlled data in this context.
-
=likely benign eval fallback resolving string annotations against base globals.Reasoning
Same annotation-resolution eval in the fallback branch with base globals; it is the standard forward-reference resolution technique and is wrapped to raise NameError on failure, consistent with legitimate typing introspection.
Reproduce This Scan
Run disclude locally to verify. These commands scan the published file; the "new in this release" marks come from comparing it with the previous release's file, which they don't repeat. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.
|