Skip to content

fix: support sqlglot 29.x/30.x and cap dependency below v31 - #71

Merged
mingjerli merged 1 commit into
mainfrom
chore/upgrade-sqlglot-30
Jul 23, 2026
Merged

fix: support sqlglot 29.x/30.x and cap dependency below v31#71
mingjerli merged 1 commit into
mainfrom
chore/upgrade-sqlglot-30

Conversation

@mingjerli

Copy link
Copy Markdown
Owner

Summary

sqlglot's latest release is 30.13.0, two major versions ahead of the 28.5.0 this repo was developed against — and the open-ended >=28.0.0 constraint meant fresh installs were already pulling untested majors.

  • Fix the one real breakage: sqlglot v30 removed parser registration for the exp.Expression base class, so parse_one(expr, into=exp.Expression) in extract_columns_from_expr raised TypeError, which the fallback handler swallowed — silently returning no columns and breaking MERGE condition lineage (9 test failures). Dropping the redundant into= argument behaves identically on 28.x.
  • Cap the constraint at >=28.0.0,<31.0.0 so future sqlglot majors can't reach users untested.
  • Update lockfile to sqlglot 30.13.0 for development.

Test plan

  • Full suite (1591 passed, 40 skipped, 2 xfailed) against sqlglot 30.13.0
  • Full suite against sqlglot 29.0.1
  • Full suite against sqlglot 28.5.0
  • make pre-commit (ruff format + lint) passes
  • Audited v30 migration guide: no sqlglot subclassing, no bfs traversal, no internal-path imports in this codebase; exp.Anonymous branches all have exp.Func fallbacks

Notes

ty reports 5 new (non-blocking) annotation-level diagnostics under sqlglot 30 because its stubs now type public APIs as exp.Expr rather than exp.Expression. Runtime is unaffected. Annotating with exp.Expr would break imports on 28.x, so these are left as-is while the 28–30 range is supported.

sqlglot v30 removed the parser registration for the exp.Expression
base class, making parse_one(expr, into=exp.Expression) raise
TypeError. The error was swallowed by the fallback handler in
extract_columns_from_expr, silently returning no columns and breaking
MERGE condition lineage. Drop the redundant into= argument, which
behaves identically on 28.x.

Full test suite (1591 tests) verified against sqlglot 28.5.0, 29.0.1,
and 30.13.0. Lockfile updated to 30.13.0 and the constraint capped at
<31.0.0 so future majors can't reach users untested.
@mingjerli
mingjerli merged commit f4fa473 into main Jul 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant