1
0
Fork 0

Adding upstream version 23.12.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:31:56 +01:00
parent efe1f986ea
commit 5d33af745d
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
93 changed files with 55455 additions and 52777 deletions

View file

@ -301,9 +301,10 @@ class Expression(metaclass=_Expression):
"""
return deepcopy(self)
def add_comments(self, comments: t.Optional[t.List[str]]) -> None:
def add_comments(self, comments: t.Optional[t.List[str]] = None) -> None:
if self.comments is None:
self.comments = []
if comments:
for comment in comments:
_, *meta = comment.split(SQLGLOT_META)
@ -314,6 +315,11 @@ class Expression(metaclass=_Expression):
self.meta[k.strip()] = value
self.comments.append(comment)
def pop_comments(self) -> t.List[str]:
comments = self.comments or []
self.comments = None
return comments
def append(self, arg_key: str, value: t.Any) -> None:
"""
Appends value to arg_key if it's a list or sets it as a new list.
@ -2058,11 +2064,11 @@ class Insert(DDL, DML):
"returning": False,
"overwrite": False,
"exists": False,
"partition": False,
"alternative": False,
"where": False,
"ignore": False,
"by_name": False,
"stored": False,
}
def with_(
@ -2911,6 +2917,7 @@ class Table(Expression):
"ordinality": False,
"when": False,
"only": False,
"partition": False,
}
@property
@ -5683,7 +5690,7 @@ class StddevSamp(AggFunc):
class TimeToStr(Func):
arg_types = {"this": True, "format": True, "culture": False}
arg_types = {"this": True, "format": True, "culture": False, "timezone": False}
class TimeToTimeStr(Func):
@ -5873,6 +5880,8 @@ FUNCTION_BY_NAME = {name: func for func in ALL_FUNCTIONS for name in func.sql_na
JSON_PATH_PARTS = subclasses(__name__, JSONPathPart, (JSONPathPart,))
PERCENTILES = (PercentileCont, PercentileDisc)
# Helpers
@t.overload