From fca58e114d6e5513bd6774e5b45eb6bc84c1aa9b Mon Sep 17 00:00:00 2001 From: Awanish Gupta Date: Thu, 18 Jun 2026 12:36:53 +0530 Subject: [PATCH] fix: Add alias_tokens parameter to _parse_join() for sqlglot 30.9.0 compatibility - 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 --- sqlmesh/core/dialect.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sqlmesh/core/dialect.py b/sqlmesh/core/dialect.py index 94b8c2f2ad..491d8c956c 100644 --- a/sqlmesh/core/dialect.py +++ b/sqlmesh/core/dialect.py @@ -315,16 +315,19 @@ def _parse_with(self: Parser, skip_with_token: bool = False) -> t.Optional[exp.E def _parse_join( - self: Parser, skip_join_token: bool = False, parse_bracket: bool = False + self: Parser, + skip_join_token: bool = False, + parse_bracket: bool = False, + alias_tokens: t.Optional[t.Collection[TokenType]] = None, ) -> t.Optional[exp.Expr]: index = self._index method, side, kind = self._parse_join_parts() macro = _parse_matching_macro(self, "JOIN") if not macro: self._retreat(index) - return self.__parse_join(skip_join_token=skip_join_token, parse_bracket=parse_bracket) # type: ignore + return self.__parse_join(skip_join_token=skip_join_token, parse_bracket=parse_bracket, alias_tokens=alias_tokens) # type: ignore - join = self.__parse_join(skip_join_token=True) # type: ignore + join = self.__parse_join(skip_join_token=True, alias_tokens=alias_tokens) # type: ignore if method: join.set("method", method.text) if side: