diff --git a/pyproject.toml b/pyproject.toml index bcc69c667e..f556092ffd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ dependencies = [ "requests", "rich[jupyter]", "ruamel.yaml", - "sqlglot~=30.4.2", + "sqlglot~=30.8.0", "tenacity", "time-machine", "json-stream" diff --git a/sqlmesh/core/dialect.py b/sqlmesh/core/dialect.py index 565c629789..2ac15c2a5c 100644 --- a/sqlmesh/core/dialect.py +++ b/sqlmesh/core/dialect.py @@ -481,10 +481,14 @@ def _parse_types( check_func: bool = False, schema: bool = False, allow_identifiers: bool = True, + with_collation: bool = False, ) -> t.Optional[exp.Expr]: start = self._curr parsed_type = self.__parse_types( # type: ignore - check_func=check_func, schema=schema, allow_identifiers=allow_identifiers + check_func=check_func, + schema=schema, + allow_identifiers=allow_identifiers, + with_collation=with_collation, ) if schema and parsed_type: diff --git a/sqlmesh/core/macros.py b/sqlmesh/core/macros.py index 9370bffdeb..c2d32bdecf 100644 --- a/sqlmesh/core/macros.py +++ b/sqlmesh/core/macros.py @@ -15,6 +15,7 @@ from sqlglot import Generator, exp, parse_one from sqlglot.executor.env import ENV from sqlglot.executor.python import Python +from sqlglot.generators.python import PythonGenerator from sqlglot.helper import csv, ensure_collection from sqlglot.optimizer.normalize_identifiers import normalize_identifiers from sqlglot.schema import MappingSchema @@ -140,9 +141,9 @@ def get(self, key: str, default: t.Any = None, /) -> t.Any: class MacroDialect(Python): - class Generator(Python.Generator): + class Generator(PythonGenerator): TRANSFORMS = { - **Python.Generator.TRANSFORMS, # type: ignore + **PythonGenerator.TRANSFORMS, exp.Column: lambda self, e: f"exp.to_column('{self.sql(e, 'this')}')", exp.Lambda: lambda self, e: f"lambda {self.expressions(e)}: {self.sql(e, 'this')}", MacroFunc: _macro_func_sql,