Skip to content

Commit 15111f8

Browse files
renovate[bot]cpcloud
authored andcommitted
fix(deps): update dependency sqlglot to >=23.4,<26.7
1 parent a548ed7 commit 15111f8

File tree

5 files changed

+17
-43
lines changed

5 files changed

+17
-43
lines changed

ibis/backends/sql/compilers/mssql.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,11 @@ def visit_NonNullLiteral(self, op, *, value, dtype):
385385
value.hour, value.minute, value.second, value.microsecond, 0
386386
)
387387
elif dtype.is_uuid():
388-
return sge.Cast(
389-
this=sge.convert(str(value)),
390-
to=sge.DataType(this=sge.DataType.Type.UNIQUEIDENTIFIER),
391-
)
388+
try:
389+
this = sge.DataType.Type.UUID
390+
except AttributeError:
391+
this = sge.DataType.Type.UNIQUEIDENTIFIER
392+
return sge.Cast(this=sge.convert(str(value)), to=sge.DataType(this=this))
392393
elif dtype.is_binary():
393394
return self.f.convert(
394395
sge.DataType(this=sge.DataType.Type.VARBINARY),

ibis/backends/sql/datatypes.py

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import contextlib
34
from functools import partial
45
from typing import NoReturn
56

@@ -66,42 +67,14 @@
6667
typecode.VARBINARY: dt.Binary,
6768
typecode.VARCHAR: dt.String,
6869
typecode.VARIANT: dt.JSON,
69-
typecode.UNIQUEIDENTIFIER: dt.UUID,
7070
typecode.SET: partial(dt.Array, dt.string),
71-
#############################
72-
# Unsupported sqlglot types #
73-
#############################
74-
# BIT = auto() # mysql
75-
# BIGSERIAL = auto()
76-
# DATETIME64 = auto() # clickhouse
77-
# ENUM = auto()
78-
# INT4RANGE = auto()
79-
# INT4MULTIRANGE = auto()
80-
# INT8RANGE = auto()
81-
# INT8MULTIRANGE = auto()
82-
# NUMRANGE = auto()
83-
# NUMMULTIRANGE = auto()
84-
# TSRANGE = auto()
85-
# TSMULTIRANGE = auto()
86-
# TSTZRANGE = auto()
87-
# TSTZMULTIRANGE = auto()
88-
# DATERANGE = auto()
89-
# DATEMULTIRANGE = auto()
90-
# HLLSKETCH = auto()
91-
# IMAGE = auto()
92-
# IPPREFIX = auto()
93-
# SERIAL = auto()
94-
# SET = auto()
95-
# SMALLSERIAL = auto()
96-
# SUPER = auto()
97-
# TIMESTAMPLTZ = auto()
98-
# UNKNOWN = auto() # Sentinel value, useful for type annotation
99-
# UINT128 = auto()
100-
# UINT256 = auto()
101-
# USERDEFINED = "USER-DEFINED"
102-
# XML = auto()
10371
}
10472

73+
74+
# typecode.UNIQUEIDENTIFIER was supplanted by typecode.UUID around sqlglot 26.6
75+
with contextlib.suppress(AttributeError):
76+
_from_sqlglot_types[typecode.UNIQUEIDENTIFIER] = dt.UUID
77+
10578
if sg.__version_tuple__[0] >= 26:
10679
_from_sqlglot_types |= {
10780
typecode.DATETIME2: dt.Timestamp,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies = [
3030
"parsy>=2",
3131
"python-dateutil>=2.8.2",
3232
"pytz>=2022.7",
33-
"sqlglot>=23.4,<26.5",
33+
"sqlglot>=23.4,<26.7",
3434
"toolz>=0.11",
3535
"typing-extensions>=4.3.0",
3636
]

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)