"read" dialect eg. parse_one(sql, read="spark")
"write" dialect eg. ast.sql(dialect="duckdb")
Description:
When running SQLMesh under a Python 3.14 environment, the application crashes during startup or compilation with an AttributeError. The error stems from a dependency or internal code referencing ast.Str, which has been completely removed in Python 3.14. [2]
Steps to Reproduce:
- Install SQLMesh on an environment running Python 3.14.
- Attempt to run sqlmesh plan, sqlmesh run, or initialize a context.
- Observe the AttributeError trace indicating module 'ast' has no attribute 'Str'. [2, 3]
Expected Behavior:
The code should dynamically check for Python version capabilities or transition fully to using ast.Constant (which replaced ast.Str, ast.Num, ast.Bytes, ast.NameConstant, and ast.Ellipsis since Python 3.8 and was finalized for removal in 3.14). [2, 4]
Environment Info:
- OS: Windows
- Python Version: 3.14+
- SQLMesh Version: 0.231.1 (or latest)
- SQLGlot Version: 28.10.1 [2]
Suggested Fix:
To ensure backwards compatibility while supporting Python 3.14+, instances of ast.Str should either be handled via an explicit version or attribute check, or mapped directly to ast.Constant.
As a temporary fallback in the codebase's entry point:
"read" dialect eg. parse_one(sql, read="spark")
"write" dialect eg. ast.sql(dialect="duckdb")
Description:
When running SQLMesh under a Python 3.14 environment, the application crashes during startup or compilation with an AttributeError. The error stems from a dependency or internal code referencing ast.Str, which has been completely removed in Python 3.14. [2]
Steps to Reproduce:
Expected Behavior:
The code should dynamically check for Python version capabilities or transition fully to using ast.Constant (which replaced ast.Str, ast.Num, ast.Bytes, ast.NameConstant, and ast.Ellipsis since Python 3.8 and was finalized for removal in 3.14). [2, 4]
Environment Info:
Suggested Fix:
To ensure backwards compatibility while supporting Python 3.14+, instances of ast.Str should either be handled via an explicit version or attribute check, or mapped directly to ast.Constant.
As a temporary fallback in the codebase's entry point: