PyPI / sqlglot / 30.24.0

sqlglot 30.24.0

Source
https://github.com/tobymao/sqlglot
Artifact scanned
sqlglot-30.24.0-py3-none-any.whl (wheel · 773.6 KB · SHA-256 9488828cc018…)
Compared with
sqlglot-30.23.0-py3-none-any.whl (0 signals introduced since)
Files
185 scanned, 5 skipped (binary, oversized, or unrecognised)
Signals
1 critical · 0 warn · 4 info
Scan time
8.4 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 5 of 5 warn and critical signals; 4 demoted to info.
Disclude version
4.3.0
Scanned (UTC)
2026-10-23 11:00

Signals

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

  1. critical dynamic-import sqlglot/serde.py:116:18

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

            module_path, class_name = class_name.rsplit(".", maxsplit=1)
            module = __import__(module_path, fromlist=[class_name])
        else:
            module = exp
    suspicious LLM, confidence 0.80 Dynamic import of a module named by a serialized class path during deserialization.
    Reasoning

    The __import__ call loads a module whose path comes from a serialized class name string via rsplit, which is a dynamic deserialization mechanism. It is severity critical, but in a SQL parser's serde module this is a plausible legitimate design for reconstructing expression classes; the risk is that deserializing untrusted input could import arbitrary modules, which is worth noting.

  2. info warn → info by review dynamic-attribute sqlglot/dialects/__init__.py:126:9

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

            attr = getattr(module, name)
            globals()[name] = attr
            return attr
    likely benign LLM, confidence 0.90 Lazy-loading of dialect classes via module __getattr__ caching into globals().
    Reasoning

    This is a module-level __getattr__ lazy-loading pattern that caches a dialect class in globals() after getattr on its own submodule; the name is restricted to known dialect names, so it is a standard lazy import idiom rather than obfuscation.

  3. info warn → info by review dynamic-execution sqlglot/executor/context.py:46:16

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

        def eval(self, code):
            return eval(code, self.env)
    
        def eval_tuple(self, codes):
    likely benign LLM, confidence 0.85 Executor evaluates compiled Python expression code in a controlled namespace.
    Reasoning

    eval is used deliberately by the sqlglot executor to evaluate generated Python code for query expressions against a controlled env dict. It is a legitimate, if risky, design for a SQL-to-Python executor, and the code originates from the library's own compiler rather than untrusted external input in an obvious way.

  4. info warn → info by review dynamic-execution sqlglot/executor/python.py:95:16

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

            sql = self.generator.generate(expression)
            return compile(sql, sql, "eval", optimize=2)
    
        def _replace_subqueries(self, expression):
    likely benign LLM, confidence 0.85 Compiles generated Python code for SQL expression evaluation in the executor.
    Reasoning

    compile of generated SQL-to-Python source with mode eval is part of the executor's query compilation pipeline; the input is the library's own generated code, not a hidden payload or encoded blob.

  5. info warn → info by review dynamic-attribute sqlglot/optimizer/__init__.py:64:9

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

                    raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from None
            globals()[name] = value
            return value
    likely benign LLM, confidence 0.90 Lazy attribute loading for optimizer submodules cached into globals().
    Reasoning

    Same module-level __getattr__ lazy-loading idiom caching a submodule attribute into globals(), raising AttributeError for unknown names; standard and benign.

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.

cargo install disclude --version 4.3.0
curl -fsSL -o sqlglot-30.24.0-py3-none-any.whl https://files.pythonhosted.org/packages/68/5f/d78f74306cc026c5f40f8808a47356dfd37461eb15eb759a20e5e9efe7d7/sqlglot-30.24.0-py3-none-any.whl
printf '%s  %s\n' 9488828cc018453b7a3ba01e65d2749c9a731314c14583695163ca1f358203fe sqlglot-30.24.0-py3-none-any.whl | shasum -a 256 -c -
unzip -q sqlglot-30.24.0-py3-none-any.whl -d pkg
disclude scan --untrusted --severity info pkg