fix: support sqlglot 29.x/30.x and cap dependency below v31 - #71
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.0constraint meant fresh installs were already pulling untested majors.exp.Expressionbase class, soparse_one(expr, into=exp.Expression)inextract_columns_from_exprraisedTypeError, which the fallback handler swallowed — silently returning no columns and breaking MERGE condition lineage (9 test failures). Dropping the redundantinto=argument behaves identically on 28.x.>=28.0.0,<31.0.0so future sqlglot majors can't reach users untested.Test plan
make pre-commit(ruff format + lint) passesbfstraversal, no internal-path imports in this codebase;exp.Anonymousbranches all haveexp.FuncfallbacksNotes
ty reports 5 new (non-blocking) annotation-level diagnostics under sqlglot 30 because its stubs now type public APIs as
exp.Exprrather thanexp.Expression. Runtime is unaffected. Annotating withexp.Exprwould break imports on 28.x, so these are left as-is while the 28–30 range is supported.