Repository navigation
Conversation
…ompatibility - Add missing alias_tokens parameter to _parse_join() method signature - Pass alias_tokens to internal __parse_join() calls - Maintain backward compatibility with optional parameter - Fixes TypeError when using sqlglot 30.9.0 or later Resolves compatibility issue where SQLMesh's _parse_join() override was incompatible with sqlglot 30.9.0's updated method signature. Signed-off-by: Awanish Gupta <awanishgupta159@gmail.com>
|
@iawanish Thanks for the PR! A few nits:
Also it looks like a bunch of ci tests failed. Prob due to sqlglot version changes in this pr |
- Update sqlglot dependency from ~=30.8.0 to ~=30.9.0 - This makes sqlglot 30.9.0 the officially supported version - Works in conjunction with the alias_tokens parameter fix - Enables full sqlglot 30.9.0 feature support Signed-off-by: Awanish Gupta <awanishgupta159@gmail.com>
83ab276 to
0c1abe1
Compare
The previous implementation used self.__parse_join() which relies on Python's name mangling and doesn't work correctly. This changes it to use super(Parser, self)._parse_join() which properly calls the parent class method. This fixes the mypy error: Parser has no attribute __parse_join Signed-off-by: Awanish Gupta <awanishgupta159@gmail.com>
|
@iawanish -- initial failure is the |
Signed-off-by: IBM Db2 Eco System <Hdm-dev-persona-db2-eco-system@ibm.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Description
Fixes #5840
This PR fixes compatibility with
sqlglot30.9.0 by updating the overridden_parse_join()method insqlmesh/core/dialect.pyto match the upstream parser signature.Problem
With
sqlglot30.9.0+, SQLMesh raises:This happens because
sqlglotintroduced thealias_tokensparameter inParser._parse_join(), while SQLMesh's override was still using the older method signature.Changes
alias_tokensparameter to_parse_join().alias_tokensto the internal__parse_join()calls.This change allows SQLMesh to work correctly with
sqlglot30.9.0+ without affecting existing behavior.Test Plan
sqlglot==30.9.0.TypeErrorno longer occurs.Checklist
make styleand fixed any issues (ruff, ruff-format and mypy pass via pre-commit)_parse_joinmake fast-test) - relying on CI; locallytests/core/test_dialect.pyandtests/core/engine_adapter/test_db2.pypass on sqlglot 30.9.0git commit -s) per the DCOSummary by CodeRabbit