PyPI / sqlalchemy / 2.0.55
sqlalchemy 2.0.55
- Source
- https://github.com/sqlalchemy/sqlalchemy
- Tag scanned
rel_2_0_55- Compared with
rel_2_0_54(0 signals introduced since)- Files
- 911 scanned, 27 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 45 info
- Scan time
- 42.1 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 41 of 41 warn and critical signals; 41 demoted to info.
- Disclude version
- 4.0.0
- Scanned (UTC)
- 2026-10-17 00:41
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
passlikely benign Example profiler dynamically imports sibling modules by name.Reasoning
Dynamic __import__ of a module name built from the package name and a discovered profiler name. This is a plugin-style loader inside a benchmark example, not a dropper. The name comes from the local package layout, not from untrusted input.
-
likely benign Example runner imports a profile module chosen by CLI argument.
Reasoning
Imports the profiler module named by a command-line argument within the same package. This is a standard dynamic-dispatch pattern for a benchmark runner, with no network, decoding, or shell involvement.
-
= . =likely benign Loads a SQLAlchemy database dialect module by name.Reasoning
Standard SQLAlchemy dialect loader that imports sqlalchemy.dialects.<name> and falls back on ImportError. The dialect name is a configured database backend name, and the module path is fixed to the package namespace.
-
= ..likely benign Loads the MariaDB driver dialect module for a given driver name.Reasoning
Driver-specific dialect loader that imports a submodule under sqlalchemy.dialects.mysql. This is the usual plugin mechanism and matches the library's design.
-
info
critical→ info by reviewdynamic-importlib/sqlalchemy/dialects/mysql/mariadbconnector.py:227:32= ..likely benign Reads CLIENT flag constants from the MariaDB connector's dbapi package.Reasoning
Imports the dbapi's own constants submodule to read CLIENT flags, guarded by try/except. The module name derives from the already-loaded dbapi, so this is ordinary driver introspection.
-
= ..likely benign Reads CLIENT flag constants from the MySQLdb dbapi package.Reasoning
Same pattern as the MariaDB connector: imports dbapi.__name__ + '.constants.CLIENT' to get flag values. This is benign driver introspection.
-
passlikely benign Optionally imports a package's provision module for testing support.Reasoning
Imports the package's own provision submodule for the test tooling, and suppresses ImportError when it is absent. This is a plugin hook with no external input.
-
# establish pickle capability by adding it to this module =likely benign Registers a dynamically created event class in module globals for pickling.Reasoning
Registers a class in module globals so that pickle can resolve it by name. This is a known, documented technique for making dynamically created classes picklable, not evasion.
-
=likely benign Evaluates developer-written relationship expression strings for the ORM class registry.Reasoning
eval evaluates relationship primaryjoin/declarative string expressions written by the developer, against a controlled namespace. It is a documented SQLAlchemy feature, and the input is developer-authored code rather than untrusted data.
-
= = =likely benign Generates a constructor from template text via exec to keep the signature.Reasoning
exec runs generated function source text for __init__ with a controlled env, to preserve the original signature. This is code generation from the library's own templates, a common and legitimate approach.
-
) =likely benign Registers a generated annotated subclass in module globals.Reasoning
Registers a generated Annotated<ClassName> class in globals() so it can be found by name and pickled. This is a standard metaprogramming pattern in the library.
-
= =likely benign Looks up a coercion implementation class from module globals.Reasoning
Looks up a module-level implementation class by name from a fixed set of module names. This is a local registry lookup and nothing about it is hidden or attacker-driven.
-
= =likely benign Executes generated helper code to rebuild closure cells.Reasoning
exec runs generated code that builds cell objects for closure reconstruction, using internal variables. This is a known technique in the library for making closures from captured values, not a payload.
-
= yieldlikely benign Imports a dialect module for test engine setup.Reasoning
Test-engine helper that imports a dialect module by name from a fixed set of test dialect names. It is part of the test harness and has no external input.
-
= . = =likely benign Uses call-stack inspection to resolve a test directory path.Reasoning
Uses inspect.stack to locate the caller's directory for resolving test file paths. This is a routine test-fixture technique with no network or execution aspect.
-
# late = =likely benign Imports a dotted module path for the pytest plugin loader.Reasoning
Standard pytest plugin helper that imports a module by dotted name and walks its attributes. The module name is the test plugin's own configuration, and this is ordinary test tooling.
-
# in format_argpsec_plus() returnlikely benign exec of generated Python source to build a function with a specific signature in the pytest plugin.Reasoning
The exec runs generated function source built by SQLAlchemy's own format_argpsec_plus helper to create a function with a given signature. This is a standard code-generation pattern in a legitimate library, not obfuscation.
-
= passlikely benign Reads the calling frame's module name to set a module attribute on a test schema object.Reasoning
sys._getframe(1) reads the caller's module name to set a default __module__ attribute, wrapped in a try/except. This is ordinary introspection for module attribution.
-
, , , =, -
, =, ) -
= = -
= = -
) -> : return # type: ignore[no-any-return]likely benign exec of generated wrapper source in langhelpers to create a callable with matching signature.Reasoning
This is the same generated-function pattern as the other exec sites in langhelpers: source built from known function metadata, executed in a controlled env, then the named function is returned. No external or encoded input is involved.
-
= =likely benign Lazy loader that imports a dotted module path and resolves attributes on it.Reasoning
The module path comes from a lazy-loading helper that imports a dotted module path given by the library's own code, then walks attributes. The critical severity is overstated for a deferred-import utility.
-
) .__defaults__ =likely benign exec of generated method source to create a wrapper that preserves defaults.Reasoning
exec compiles generated method source, then copies defaults from the original function onto the new method. This is a standard decorator-generation technique with no sign of hidden payload.
-
= # being called from less than 3 (or given) stacklevels, weird,likely benign Walks up the call stack to find the caller location for warnings.Reasoning
sys._getframe(stacklevel) is used to find the caller for warning or deprecation messages, with a ValueError fallback. The anti-analysis tag is a false association with sys.exit/exec in the same file; the frame use is ordinary.
-
= returnlikely benign exec of generated source that returns a named helper from a local namespace.Reasoning
exec runs generated source for a set-like helper using a copied locals env, then returns the named entry. This is a code-generation idiom, not an encoded or hidden payload.
-
) and not in : = =likely benign Lazy import of a known SQLAlchemy submodule that caches the result on first access.Reasoning
This is a lazy module loader that calls __import__ on a fixed module name from the library's own registry, then caches the result. Critical severity is not warranted for a standard deferred-import pattern.
-
= =likely benign Caches a lazily imported module into globals and the instance dict by name.Reasoning
globals()[key] is used to cache the lazily imported module under its attribute name. This is a normal module-level caching technique and the keys are internal.
-
= =likely benign eval of a string type annotation against class or module namespaces.Reasoning
eval resolves string type annotations (forward references) against class and module namespaces. This is the standard mechanism for resolving PEP 563 annotations, and the expression comes from annotations in source code.
-
=likely benign eval of a string annotation against base globals with error wrapping.Reasoning
Same forward-reference resolution as the adjacent eval, using base globals. The expression is a type annotation string, and the surrounding code wraps failures in a NameError.
-
= returnlikely benign Test helper that execs a locally built code snippet to obtain typing variables.Reasoning
This test helper exec's a code string it constructs in a fresh scope to check typing behavior. It is test scaffolding, and the code is authored in the test file itself.
-
= =likely benign Compiles and executes a bootstrap file read from the repo at conftest import time.Reasoning
conftest reads bootstrap.py from the repository and compiles it, then runs it. This is the known bootstrap pattern in SQLAlchemy's test suite, which loads a file that lives in the repo. Module-scope execution is unusual but the source is local and not fetched or decoded from a blob.
-
= # noqalikely benign Executes the repo-local bootstrap code at conftest import to set up the pytest plugin.Reasoning
The exec runs the repo-local bootstrap code compiled just before. Module-scope execution is intentional for test-plugin setup. The source is a checked-in file, not a remote or encoded payload.
-
# test that repr() copies out all argumentslikely benign Test evaluates a repr string of a MySQL type to verify round-tripping.Reasoning
eval of a formatted repr of a type instance in a test checks that repr round-trips. The input is a test-controlled object, not external data.
-
= ..likely benign Imports psycopg's errors submodule to reference a transaction exception class in a test.Reasoning
__import__ loads the psycopg errors submodule by name derived from the already-imported psycopg module, to get the TransactionRollback exception class. This is a version-compatibility import in a test.
-
= ..likely benign Test-only dynamic import of psycopg's extensions module to get an exception class.Reasoning
The __import__ call builds the module name from psycopg.__name__ to fetch TransactionRollbackError. This is a standard way to resolve an optional driver submodule in a test, and the input is not attacker-controlled.
-
returnlikely benign Test helper that imports every SQLAlchemy dialect package by name.Reasoning
The module name is formatted from the known dialect names in sqlalchemy.dialects.__all__. This is a test helper enumerating its own package's dialects, with no external input.
-
):likely benign Test exec of a templated dialect import and instantiation.Reasoning
The exec'd code is a fixed template that imports a dialect module and instantiates it, parameterized by the dialect name from the test's own parameter list. It is typical test scaffolding.
-
likely benign Test file exec'ing operator expressions that also imports pickle.
Reasoning
The file imports pickle, which is ordinary for serialization tests. The exec calls build Python comparison expressions from a fixed set of operators in the test itself, so the decoder-plus-exec shape is a coincidence of test content, not a payload chain.
-
likely benign Test exec of a comparison expression assembled from a loop operator.
Reasoning
The exec string is built from a fixed operator in the test's own loop over comparison operators. It evaluates test-authored expressions with no external input.
-
likely benign Test exec of a comparison expression built from a loop operator.
Reasoning
Same pattern as the sibling exec in this loop: a test-authored comparison expression is built from a fixed operator set. No untrusted data reaches it.
-
return ,likely benign Test exec that defines a dynamically generated class fixture.Reasoning
The code string is generated within the test to declare a class with the expected names, and it is exec'd into a local globals dict. This is a common technique for building dynamic test fixtures.
-
likely benign Perf script that launches the runsnake profiler viewer on a output file.
Reasoning
This is a developer-run performance script that shells out to runsnake with a filename, which is most likely a command-line argument. The risk is limited to whoever runs the script, and the code does nothing hidden.
-
= =likely benign Test exec that builds a generated lambda-statement function.Reasoning
The exec'd code is generated in the test to build a lambda-statement generator, and its namespace is a local dict. This is a deliberate fixture for testing lambda SQL construction.
Reproduce This Scan
Run disclude locally to verify. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.
&&