1
0
Fork 0

Merging upstream version 20.1.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:17:09 +01:00
parent d4fe7bdb16
commit 90988d8258
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
127 changed files with 73384 additions and 73067 deletions

View file

@ -22,6 +22,7 @@ from sqlglot.expressions import (
Expression as Expression,
alias_ as alias,
and_ as and_,
case as case,
cast as cast,
column as column,
condition as condition,
@ -82,8 +83,7 @@ def parse(
Returns:
The resulting syntax tree collection.
"""
dialect = Dialect.get_or_raise(read or dialect)()
return dialect.parse(sql, **opts)
return Dialect.get_or_raise(read or dialect).parse(sql, **opts)
@t.overload
@ -117,7 +117,7 @@ def parse_one(
The syntax tree for the first parsed statement.
"""
dialect = Dialect.get_or_raise(read or dialect)()
dialect = Dialect.get_or_raise(read or dialect)
if into:
result = dialect.parse_into(into, sql, **opts)
@ -157,7 +157,8 @@ def transpile(
The list of transpiled SQL statements.
"""
write = (read if write is None else write) if identity else write
write = Dialect.get_or_raise(write)
return [
Dialect.get_or_raise(write)().generate(expression, copy=False, **opts) if expression else ""
write.generate(expression, copy=False, **opts) if expression else ""
for expression in parse(sql, read, error_level=error_level)
]