PyPI / sqlalchemy / 2.1.4

sqlalchemy 2.1.4

Source
https://github.com/sqlalchemy/sqlalchemy
Tag scanned
rel_2_1_4
Compared with
rel_2_1_3 (0 signals introduced since)
Files
890 scanned, 17 skipped (binary, oversized, or unrecognised)
Signals
2 critical · 0 warn · 44 info
Scan time
36.1 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 42 of 42 warn and critical signals; 40 demoted to info.
Disclude version
4.0.0
Scanned (UTC)
2026-10-14 18:23

Signals

Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.

  1. critical dynamic-execution test/conftest.py:56:12

    `compile` at module scope (runs on import) on a non-literal expression (ast pass, confidence 0.80)

    with open(bootstrap_file) as f:
        code = compile(f.read(), "bootstrap.py", "exec")
        to_bootstrap = "pytest"
        exec(code, globals(), locals())
    suspicious LLM, confidence 0.70 conftest loads and executes a bootstrap.py file at import time to set up the pytest plugin.
    Reasoning

    Module-scope compile and exec of an external bootstrap file that imports the sqla_pytestplugin into the test namespace. This is an unusual, opaque loading pattern in conftest, but the file is a bundled project bootstrap, so the source is in-repo and readable. Benign-looking but worth a check of bootstrap.py.

  2. critical dynamic-execution test/conftest.py:58:5

    `exec` at module scope (runs on import) on a non-literal expression (ast pass, confidence 0.80)

        to_bootstrap = "pytest"
        exec(code, globals(), locals())
        from sqla_pytestplugin import *  # noqa
    suspicious LLM, confidence 0.70 Module-level exec runs the bootstrap code, which then provides the pytest plugin star-import.
    Reasoning

    Same pattern as the compile finding: exec of a bootstrap file at module scope, followed by a star-import. Executing code from a file in the repo on import is a dynamic loading pattern worth verifying against the bootstrap source, but it is not itself evidence of a payload.

  3. info critical → info by review dynamic-import examples/performance/__init__.py:335:21

    `__import__` called on a non-literal expression (ast pass, confidence 0.90)

                    try:
                        __import__(__name__ + "." + potential_name)
                    except ImportError:
                        pass
    likely benign LLM, confidence 0.85 Dynamic __import__ of a sibling package module by name in the performance examples.
    Reasoning

    The import name is built from a loop variable inside a try/except ImportError, which is the usual pattern for optionally loading example or profiler modules. The import stays inside the package namespace and no untrusted input is evident in the snippet.

  4. info critical → info by review dynamic-import examples/performance/__init__.py:394:13

    `__import__` called on a non-literal expression (ast pass, confidence 0.90)

            if cls.name is None:
                __import__(__name__ + "." + args.name)
    
            Profiler(args).run()
    likely benign LLM, confidence 0.85 Dynamic import of a profiler module chosen by a CLI argument in the performance examples.
    Reasoning

    The module name is built from __name__ and args.name, where args comes from the example's own command-line parser. This is a developer-facing example runner selecting one of its own profiler modules, not a payload loader.

  5. info critical → info by review dynamic-import lib/sqlalchemy/dialects/__init__.py:48:22

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

            else:
                module = __import__("sqlalchemy.dialects.%s" % (dialect,)).dialects
                module = getattr(module, dialect)
        except ImportError:
    likely benign LLM, confidence 0.90 Dynamic import of a SQLAlchemy dialect module by name.
    Reasoning

    This is SQLAlchemy's standard dialect loader, importing sqlalchemy.dialects.<name> for a dialect name the library itself resolves. It is a documented plugin mechanism, not obfuscation.

  6. info critical → info by review dynamic-import lib/sqlalchemy/dialects/mysql/mariadb.py:49:19

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

    def loader(driver: str) -> type[MariaDBDialect]:
        dialect_mod = __import__(
            "sqlalchemy.dialects.mysql.%s" % driver
        ).dialects.mysql
    likely benign LLM, confidence 0.90 Dynamic import of a MySQL driver-specific module in the MariaDB dialect loader.
    Reasoning

    The import path is a fixed package prefix plus a driver name chosen from a known set of MySQL DBAPI drivers. This is ordinary plugin loading in SQLAlchemy's dialect code.

  7. info critical → info by review dynamic-import lib/sqlalchemy/dialects/mysql/mariadbconnector.py:210:32

    `__import__` called on a non-literal expression (ast pass, confidence 0.90)

                try:
                    CLIENT_FLAGS = __import__(
                        self.dbapi.__name__ + ".constants.CLIENT"
                    ).constants.CLIENT
    likely benign LLM, confidence 0.90 Dynamic import of the MariaDB connector's constants module, derived from the loaded DBAPI's name.
    Reasoning

    The import derives from the DBAPI module's own __name__ to reach its constants submodule, which is a standard way to locate driver constants. It is wrapped in a try block for optional support.

  8. info critical → info by review dynamic-import lib/sqlalchemy/dialects/mysql/mysqldb.py:260:32

    `__import__` called on a non-literal expression (ast pass, confidence 0.90)

                try:
                    CLIENT_FLAGS = __import__(
                        self.dbapi.__name__ + ".constants.CLIENT"
                    ).constants.CLIENT
    likely benign LLM, confidence 0.90 Dynamic import of the mysqldb driver's constants module.
    Reasoning

    This matches the MariaDB connector pattern: it derives the constants path from the loaded DBAPI's __name__ inside a try block. It is a normal driver-compatibility lookup.

  9. info critical → info by review dynamic-import lib/sqlalchemy/engine/default.py:742:13

    `__import__` called on a non-literal expression (ast pass, confidence 0.90)

            try:
                __import__(package + ".provision")
            except ImportError:
                pass
    likely benign LLM, confidence 0.85 Optional import of a package's provision submodule.
    Reasoning

    The import of '<package>.provision' is guarded by ImportError and belongs to SQLAlchemy's testing/provisioning machinery, where the package name is a library-controlled identifier.

  10. info warn → info by review dynamic-attribute lib/sqlalchemy/event/base.py:335:9

    reach-by-name through `globals` (ast pass, confidence 0.60)

            # establish pickle capability by adding it to this module
            globals()[klass.__name__] = klass
    likely benign LLM, confidence 0.85 Registers a dynamically created event class in module globals so pickling works.
    Reasoning

    The comment says this establishes pickle capability by registering the class in module globals, which is a known SQLAlchemy idiom for making dynamically generated classes picklable. No external input is involved.

  11. info warn → info by review dynamic-execution lib/sqlalchemy/orm/clsregistry.py:592:21

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

                try:
                    x = eval(self.arg, globals(), self._dict)
    
                    if isinstance(x, _GetColumns):
    likely benign LLM, confidence 0.80 eval of a relationship argument string against the declarative class registry.
    Reasoning

    SQLAlchemy's declarative registry evaluates developer-written string expressions in relationship and foreign-key arguments against the class registry. This is a documented feature, and the eval is scoped to a restricted dict, though it does run code from class definitions.

  12. info warn → info by review dynamic-attribute lib/sqlalchemy/sql/annotation.py:562:5

    reach-by-name through `globals` (ast pass, confidence 0.60)

        )
        globals()["Annotated%s" % cls.__name__] = anno_cls
    
        if "_traverse_internals" in cls.__dict__:
    likely benign LLM, confidence 0.85 Registers a generated Annotated class in module globals by name.
    Reasoning

    The name is built from the class name, and the generated annotated class is registered in globals so it can be pickled and referenced. This is ordinary metaprogramming in SQLAlchemy's annotation module.

  13. info warn → info by review dynamic-attribute lib/sqlalchemy/sql/coercions.py:1366:20

    reach-by-name through `globals` (ast pass, confidence 0.60)

            if name in globals():
                impl = globals()[name](cls)
                _impl_lookup[cls] = impl
    likely benign LLM, confidence 0.85 Looks up and instantiates a coercion implementation class from module globals.
    Reasoning

    The lookup checks globals for a name and instantiates the matching implementation class to populate a registry. This is internal dispatch over the module's own classes, not attacker-controlled reach.

  14. info warn → info by review dynamic-execution lib/sqlalchemy/sql/lambdas.py:1264:9

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

            vars_ = {"o%d" % i: cell_values[i] for i in argrange}
            exec(code, vars_, vars_)
            closure = vars_["make_cells"]()
    likely benign LLM, confidence 0.80 exec of generated code to construct closure cells for lambda caching.
    Reasoning

    The exec runs generated code that builds closure cells for SQLAlchemy's lambda statement caching, with the code generated internally from a fixed template and cell values passed as variables. It is a known performance technique, not a payload, though exec is inherently sensitive.

  15. info critical → info by review dynamic-import lib/sqlalchemy/testing/engines.py:250:17

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

                mod = getattr(
                    __import__("sqlalchemy.dialects.%s" % name).dialects, name
                )
            yield mod.dialect()
    likely benign LLM, confidence 0.90 Dynamic import of a SQLAlchemy dialect module in the testing engine helper.
    Reasoning

    This is test-engine setup importing sqlalchemy.dialects.<name> for a dialect name from the test suite's own configuration. It is a plain dynamic module load in test utilities.

  16. info warn → info by review frame-introspection lib/sqlalchemy/testing/fixtures/mypy.py:118:27

    `inspect.stack` — call-stack frame introspection (ast pass, confidence 0.70)

            else:
                caller_path = inspect.stack()[1].filename
                path = os.path.join(os.path.dirname(caller_path), dirname)
            files = list(Path(path).glob("**/*.py"))
    likely benign LLM, confidence 0.90 Reads the calling file's path via the call stack to build a directory for mypy test files.
    Reasoning

    inspect.stack()[1].filename is used only to locate the caller's directory so test fixture files can be globbed relative to it. This is ordinary test-helper path resolution with no network, decoding, or execution involved.

  17. info critical → info by review dynamic-import lib/sqlalchemy/testing/plugin/plugin_base.py:487:11

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

        # late
        mod = __import__(modname)
        for component in modname.split(".")[1:]:
            mod = getattr(mod, component)
    likely benign LLM, confidence 0.85 Dynamically imports a module by name from test configuration and resolves its components.
    Reasoning

    This is a dotted-path module loader for SQLAlchemy's test plugin. It imports a module name that comes from configuration and then walks attributes. Dynamic import is expected in a plugin system, and the snippet shows nothing hidden or encoded. The critical severity reflects the signal, not the context.

  18. info warn → info by review dynamic-execution lib/sqlalchemy/testing/plugin/pytestplugin.py:671:9

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

            # in format_argpsec_plus()
            exec(code, env)
            return env[fn_name]
    likely benign LLM, confidence 0.90 Executes generated function source in a namespace and returns the resulting function.
    Reasoning

    exec runs generated source for a function built from an argspec, which matches SQLAlchemy's known decorator-generation approach for preserving signatures. The code is produced by the library itself, not fetched from outside.

  19. info warn → info by review frame-introspection lib/sqlalchemy/testing/schema.py:192:18

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

        try:
            module = sys._getframe(1).f_globals.get("__name__", "__main__")
        except (AttributeError, ValueError):
            pass
    likely benign LLM, confidence 0.90 Reads the calling module's __name__ through the frame's globals.
    Reasoning

    sys._getframe(1).f_globals is used to read the caller's module name for a default value, guarded by exception handling. This is a common and benign way to get __name__ from the caller.

  20. identifier `é試蛇ẟΩ` mixes scripts: Latin + Han + Greek (in string/comment) (raw pass, confidence 0.40)

                metadata,
                Column("unicode", Integer, comment="é試蛇ẟΩ"),
                Column("emoji", Integer, comment="☁⟨U+FE0F⟩✨"),
                comment="試蛇ẟΩ✨",
  21. identifier `試蛇ẟΩ` mixes scripts: Han + Latin + Greek (in string/comment) (raw pass, confidence 0.40)

                Column("emoji", Integer, comment="☁⟨U+FE0F⟩✨"),
                comment="試蛇ẟΩ✨",
            )
  22. identifier `試蛇ẟΩ` mixes scripts: Han + Latin + Greek (in string/comment) (raw pass, confidence 0.40)

            tc = insp.get_table_comment("unicode_comments")
            eq_(tc, {"text": "試蛇ẟΩ✨"})
    
            cols = insp.get_columns("unicode_comments")
  23. identifier `é試蛇ẟΩ` mixes scripts: Latin + Han + Greek (in string/comment) (raw pass, confidence 0.40)

            value = {c["name"]: c["comment"] for c in cols}
            exp = {"unicode": "é試蛇ẟΩ", "emoji": "☁⟨U+FE0F⟩✨"}
            eq_(value, exp)
  24. info warn → info by review dynamic-execution lib/sqlalchemy/util/langhelpers.py:453:16

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

                linecache_cache[filename] = entry
            code = compile(code, filename, "exec")
    
        exec(code, env)
    likely benign LLM, confidence 0.90 Compiles generated function source into a code object for later execution.
    Reasoning

    compile turns generated function source into a code object, with the filename preserved and an entry added to linecache. This is the standard approach for generating functions with a correct traceback, and the source comes from the library's own templates.

  25. info warn → info by review dynamic-execution lib/sqlalchemy/util/langhelpers.py:455:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

    
        exec(code, env)
        fn = env[fn_name]
    likely benign LLM, confidence 0.90 Executes compiled generated source in a local namespace to create a function.
    Reasoning

    This exec follows the compile call and runs the generated code in a controlled env dict to produce the function. It is the same known generated-function pattern, not obfuscated payload delivery.

  26. info critical → info by review dynamic-import lib/sqlalchemy/util/langhelpers.py:507:19

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

            def load():
                mod = __import__(modulepath)
                for token in modulepath.split(".")[1:]:
                    mod = getattr(mod, token)
    likely benign LLM, confidence 0.90 Lazily imports a module from a dotted path and fetches an attribute from it.
    Reasoning

    This is a lazy-loader that imports a dotted module path and walks its attributes to obtain an object. It is a standard deferred-import helper in a large library, and nothing in the snippet is encoded or hidden.

  27. info critical → info by review frame-introspection lib/sqlalchemy/util/langhelpers.py:2060:17

    `sys._getframe` — call-stack frame introspection — file also calls `sys.exit`/`exec`/`eval` (anti-analysis shape) (ast pass, confidence 0.85)

        try:
            frame = sys._getframe(stacklevel)
        except ValueError:
            # being called from less than 3 (or given) stacklevels, weird,
    likely benign LLM, confidence 0.90 Fetches a caller frame at a given stack depth for warning attribution.
    Reasoning

    sys._getframe(stacklevel) is used in a warning helper to find the caller frame for the stacklevel, with a ValueError fallback when the stack is shallow. The anti-analysis flag comes only from co-occurrence of exit or exec elsewhere in the file, which is a weak signal for this legitimate use.

  28. info warn → info by review dynamic-execution lib/sqlalchemy/util/langhelpers.py:2163:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        env = locals().copy()
        exec(code, env)
        return env["set"]
    likely benign LLM, confidence 0.90 Executes generated function source in a copied locals namespace and returns the resulting callable.
    Reasoning

    exec runs generated source with a copy of locals to produce a set function, consistent with the library's other generated-function helpers. The source originates in the library, not from external input.

  29. info critical → info by review dynamic-import lib/sqlalchemy/util/preloaded.py:142:17

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

                ) and key not in self.__dict__:
                    __import__(module, globals(), locals())
                    self.__dict__[key] = globals()[key] = sys.modules[module]
    likely benign LLM, confidence 0.90 Imports a module on demand and caches the result on the instance and globals.
    Reasoning

    This is a lazy-module preloader that imports a module when it is first accessed and caches it on the instance and globals. Deferred importing is a well-known pattern for reducing import cost, and the module name is internal.

  30. info warn → info by review dynamic-attribute lib/sqlalchemy/util/preloaded.py:143:38

    reach-by-name through `globals` (ast pass, confidence 0.60)

                    __import__(module, globals(), locals())
                    self.__dict__[key] = globals()[key] = sys.modules[module]
    likely benign LLM, confidence 0.85 Caches a lazily imported module into globals and the instance dict by key.
    Reasoning

    globals() is used for dictionary-based name caching immediately after the lazy import, which is the same deferred-loading mechanism. The reach-by-name pattern here is ordinary attribute caching, not hidden access.

  31. info warn → info by review dynamic-execution lib/sqlalchemy/util/typing.py:265:26

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

    
                annotation = eval(expression, cls_namespace, locals_)
            else:
                annotation = eval(expression, base_globals, locals_)
    likely benign LLM, confidence 0.90 Evaluates a string type annotation in the class namespace to resolve it.
    Reasoning

    eval resolves string or forward-reference type annotations against the class namespace, which is required for typing support in SQLAlchemy. The expression is a type annotation from the library's own code or user declarations, not an external payload.

  32. info warn → info by review dynamic-execution lib/sqlalchemy/util/typing.py:267:26

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

            else:
                annotation = eval(expression, base_globals, locals_)
        except Exception as err:
            raise NameError(
    likely benign LLM, confidence 0.90 Evaluates a string type annotation against base module globals to resolve it.
    Reasoning

    This is the base-globals branch of the same annotation resolution with eval, and it is a standard way to resolve forward references. It is expected in a type-introspection utility.

  33. info warn → info by review dynamic-execution test/base/test_typing_utils.py:243:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        scope = {}
        exec(code, None, scope)
        if len(vars) == 1:
            return scope[vars[0]]
    likely benign LLM, confidence 0.85 Test helper executes generated source code into a scope dict to fetch variables.
    Reasoning

    exec on a locally built code string in a test helper that builds a scope dict to extract typed names; a common test-generation idiom, with no network or obfuscated payload.

  34. info warn → info by review dynamic-execution test/dialect/mysql/test_types.py:202:29

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

            # test that repr() copies out all arguments
            self.assert_compile(eval("mysql.%r" % type_inst), res)
    
        @testing.combinations(
    likely benign LLM, confidence 0.90 Test evals repr output of a MySQL type to check it reconstructs correctly.
    Reasoning

    eval of a formatted repr string of a type instance in a test verifying repr round-trips. Standard test technique, no external input.

  35. info critical → info by review dynamic-import test/dialect/postgresql/test_dialect.py:1271:40

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

            if psycopg.__version__.startswith("3"):
                TransactionRollbackError = __import__(
                    "%s.errors" % psycopg.__name__
                ).errors.TransactionRollback
    likely benign LLM, confidence 0.90 Dynamically imports the psycopg errors module to get TransactionRollback for version compatibility.
    Reasoning

    __import__ of the psycopg errors submodule based on the installed psycopg name, a standard version-dependent import. No obfuscation.

  36. info critical → info by review dynamic-import test/dialect/postgresql/test_dialect.py:1275:40

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

            else:
                TransactionRollbackError = __import__(
                    "%s.extensions" % psycopg.__name__
                ).extensions.TransactionRollbackError
    likely benign LLM, confidence 0.90 Dynamically imports psycopg extensions for version-dependent exception class lookup.
    Reasoning

    Same version-compatibility __import__ of psycopg extensions module, a routine test shim.

  37. info critical → info by review dynamic-import test/dialect/test_all.py:9:21

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

            return [
                getattr(__import__("sqlalchemy.dialects.%s" % d).dialects, d)
                for d in dialects.__all__
                if not d.startswith("_")
    likely benign LLM, confidence 0.90 Collects dialect modules by dynamically importing names from the package's own dialect list.
    Reasoning

    Imports each SQLAlchemy dialect module by name from dialects.__all__ to collect them. Routine, sourced from a fixed in-package list.

  38. info warn → info by review dynamic-execution test/engine/test_parseconnect.py:541:13

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

            ):
                exec(
                    "from sqlalchemy.dialects import %s\ndialect = "
                    "%s.dialect()" % (name, name),
    likely benign LLM, confidence 0.85 Test execs a generated import of a dialect module to check dialect resolution.
    Reasoning

    exec builds a fixed template importing a dialect by name in a test verifying dialect loading. The name comes from test parameters, not external input.

  39. info warn → info by review decoder-import-with-exec test/ext/test_associationproxy.py:918:21

    file imports decoder module(s) pickle and calls `exec`/`eval`/`compile` — multi-stage payload shape (ast pass, confidence 0.80)

    
                        exec("p.children %s other" % op)
                        exec("control %s other" % op)
    likely benign LLM, confidence 0.80 Test execs generated comparison expressions over a fixed operator set.
    Reasoning

    Operator-driven exec of strings built from a fixed operator list in a test comparing proxy expressions. The 'decoder import' signal is a heuristic false positive since pickle is unrelated to this exec of local expression strings.

  40. info warn → info by review dynamic-execution test/ext/test_associationproxy.py:918:21

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

    
                        exec("p.children %s other" % op)
                        exec("control %s other" % op)
    likely benign LLM, confidence 0.85 Test execs formatted comparison expression strings built from a fixed operator.
    Reasoning

    exec of an expression string formatted with a test-controlled operator, in a test of association proxy comparisons. Not external input.

  41. info warn → info by review dynamic-execution test/ext/test_associationproxy.py:919:21

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

                        exec("p.children %s other" % op)
                        exec("control %s other" % op)
    
                        try:
    likely benign LLM, confidence 0.85 Second exec of formatted comparison expression in the same association proxy test.
    Reasoning

    Same generated-expression exec over a fixed operator in a test; no external input or obfuscation.

  42. info warn → info by review dynamic-execution test/orm/test_inspect.py:513:9

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

    
            exec(code, glbls)
            return names, glbls[clsname]
    likely benign LLM, confidence 0.85 Test execs generated class source into a namespace to inspect the resulting class.
    Reasoning

    exec of generated class source in a glbls namespace to build a test class for inspection. Standard metaprogramming in tests.

  43. info critical → info by review dynamic-execution test/perf/orm2010.py:167:9

    `os.system` called on a non-literal command — runtime-determined shell invocation (ast pass, confidence 0.85)

        if runsnake:
            os.system("runsnake %s" % filename)
    likely benign LLM, confidence 0.80 Perf script shells out to runsnake to visualize a profile file when enabled.
    Reasoning

    os.system runs a profiling tool (runsnake) on a filename in a perf script gated by a flag. Runtime shell invocation with a local filename, though it is not a payload; the filename is not externally sourced.

  44. info warn → info by review dynamic-execution test/sql/test_lambdas.py:2220:9

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

            d = {"A": A, "__name__": "lambda_fake"}
            exec(code, d)
            generate_lambda_stmt = d["generate_lambda_stmt"]
    likely benign LLM, confidence 0.80 A test helper uses exec on generated source to build a lambda-statement function inside an isolated namespace dict.
    Reasoning

    The exec call runs code inside a test helper with a controlled namespace dict. The snippet shows the code is a generated lambda-statement fixture, and the test then pulls a function out of the namespace. This is a common test pattern and not evidence of a dropper. The code variable's origin is not shown, which keeps confidence below the top band.

  45. info warn → info by review decoder-import-with-exec test/sql/test_metadata.py:7645:13

    file imports decoder module(s) pickle and calls `exec`/`eval`/`compile` — multi-stage payload shape (ast pass, confidence 0.80)

            # the repr round trips
            eq_(eval(repr(fk)).target_tokens, fk.target_tokens)
    
        def test_no_such_column_error_message(self):
    likely benign LLM, confidence 0.80 A SQLAlchemy test checks that a ForeignKey's repr round-trips through eval, in a file that also imports pickle.
    Reasoning

    The file imports pickle, which triggers the decoder-import heuristic, and it also calls eval. The snippet shows eval(repr(fk)) inside a test that checks that a ForeignKey repr round-trips. That is ordinary unit-test code. The multi-stage payload shape is not present: nothing is decoded from an encoded blob and then executed.

  46. info warn → info by review dynamic-execution test/sql/test_metadata.py:7645:13

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

            # the repr round trips
            eq_(eval(repr(fk)).target_tokens, fk.target_tokens)
    
        def test_no_such_column_error_message(self):
    likely benign LLM, confidence 0.90 eval is applied to the repr of a local ForeignKey object to verify that the repr round-trips in a test.
    Reasoning

    The eval argument is repr(fk), the repr of a local ForeignKey object, and the result is compared against fk.target_tokens. This is a deliberate round-trip assertion in a test. The input is not attacker-controlled and no external data reaches eval.

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.

cargo install disclude --version 4.0.0
git clone https://github.com/sqlalchemy/sqlalchemy sqlalchemy && cd sqlalchemy
git checkout rel_2_1_4
disclude scan --severity info --diff rel_2_1_3 .