We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d8bbcd2 commit 8856ffdCopy full SHA for 8856ffd
sqlmesh/core/dialect.py
@@ -566,6 +566,10 @@ def _parse_if(self: Parser) -> t.Optional[exp.Expr]:
566
if last_token.token_type == TokenType.R_PAREN:
567
self._tokens[-2].comments.extend(last_token.comments)
568
self._tokens.pop()
569
+ if hasattr(self, "_tokens_size"):
570
+ # keep _tokens_size in sync sqlglot 30.0.3 caches len(_tokens)
571
+ # _advance() tries to read tokens[index + 1] past the new end
572
+ self._tokens_size -= 1
573
else:
574
self.raise_error("Expecting )")
575
0 commit comments