You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Upgrade to sqlglot 30.9.0 to support external dialect plugins #5840
While working on a DB2 adapter for SQLMesh, I encountered a compatibility issue with sqlglot 30.9.0.
The DB2 implementation relies on an external DB2 dialect plugin, which currently requires sqlglot==30.9.0. However, SQLMesh is currently pinned to sqlglot~=30.8.0. Upgrading to sqlglot 30.9.0 exposes an API incompatibility in SQLMesh's parser overrides.
Observed Error
TypeError: _parse_join() got an unexpected keyword argument 'alias_tokens'
Root Cause
The signature of Parser._parse_join() changed between sqlglot 30.8.0 and 30.9.0.
SQLMesh overrides this method in dialect.py, but the override does not currently accept the new alias_tokens parameter.
As a result, when sqlglot 30.9.0 internally invokes:
_parse_join(alias_tokens=...)
SQLMesh raises the exception shown above.
Impact
Prevents SQLMesh from working with sqlglot 30.9.0
Blocks integration with external dialect plugins that depend on newer sqlglot versions
Affects DB2 adapter development, where the DB2 dialect plugin currently requires sqlglot 30.9.0
Possible Resolution
Either:
Upgrade SQLMesh to support sqlglot 30.9.0, or
Make the _parse_join() override forward-compatible with newer sqlglot parser signatures.
Additional Context
I discovered this issue while implementing a DB2 adapter, but the underlying problem appears to be a general compatibility issue with newer sqlglot releases rather than something specific to DB2.
Proposed Contribution
I believe I have a fix for this issue and would be happy to contribute it as a PR if maintaining compatibility with sqlglot 30.9.0 is something the project would like to support.
Activity