Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies = [
"requests",
"rich[jupyter]",
"ruamel.yaml",
"sqlglot~=30.4.2",
"sqlglot~=30.8.0",
"tenacity",
"time-machine",
"json-stream"
Expand Down
6 changes: 5 additions & 1 deletion sqlmesh/core/dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions sqlmesh/core/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Loading