Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency sqlglot to v24 #9229

Merged
merged 7 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ibis/backends/clickhouse/tests/test_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import hypothesis as h
import hypothesis.strategies as st
import pytest
import sqlglot as sg
import sqlglot.expressions as sge
from packaging.version import parse as vparse
from pytest import param

import ibis
Expand Down Expand Up @@ -192,6 +194,11 @@ def test_array_discovery_clickhouse(con):
),
nullable=False,
),
marks=pytest.mark.xfail(
vparse(sg.__version__) == vparse("24.0.0"),
reason="struct parsing for clickhouse broken in sqlglot 24",
raises=sg.ParseError,
),
id="named_tuple",
),
param(
Expand All @@ -203,6 +210,11 @@ def test_array_discovery_clickhouse(con):
),
nullable=False,
),
marks=pytest.mark.xfail(
vparse("24.0.0") <= vparse(sg.__version__) <= vparse("24.0.1"),
reason="struct parsing for clickhouse broken in sqlglot 24",
raises=sg.ParseError,
),
id="unnamed_tuple",
),
param(
Expand All @@ -214,6 +226,11 @@ def test_array_discovery_clickhouse(con):
),
nullable=False,
),
marks=pytest.mark.xfail(
vparse("24.0.0") <= vparse(sg.__version__) <= vparse("24.0.1"),
reason="struct parsing for clickhouse broken in sqlglot 24",
raises=sg.ParseError,
),
id="partially_named",
),
param(
Expand Down
4 changes: 3 additions & 1 deletion ibis/backends/mysql/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ def visit_StringFind(self, op, *, arg, substr, start, end):

def visit_LRStrip(self, op, *, arg, position):
return reduce(
lambda arg, char: self.f.trim(this=arg, position=position, expression=char),
lambda arg, char: self.f.trim(
this=arg, position=self.v[position], expression=char
),
map(
partial(self.cast, to=dt.string),
map(self.f.unhex, map(self.f.hex, string.whitespace.encode())),
Expand Down
4 changes: 3 additions & 1 deletion ibis/backends/postgres/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ def visit_ArrayConcat(self, op, *, arg):

def visit_ArrayContains(self, op, *, arg, other):
arg_dtype = op.arg.dtype
return sge.ArrayContains(
# ArrayContainsAll introduced in 24, keep backcompat if it doesn't exist
cls = getattr(sge, "ArrayContainsAll", sge.ArrayContains)
return cls(
this=self.cast(arg, arg_dtype),
expression=self.f.array(self.cast(other, arg_dtype.value_type)),
)
Expand Down
13 changes: 8 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pyarrow-hotfix = ">=0.4,<1"
python-dateutil = ">=2.8.2,<3"
pytz = ">=2022.7"
rich = ">=12.4.4,<14"
sqlglot = ">=23.4,<23.18"
sqlglot = ">=23.4,<24.1"
toolz = ">=0.11,<1"
typing-extensions = ">=4.3.0,<5"
black = { version = ">=22.1.0,<25", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ sortedcontainers==2.4.0 ; python_version >= "3.10" and python_version < "4.0"
soupsieve==2.5 ; python_version >= "3.10" and python_version < "3.13"
sphobjinv==2.3.1 ; python_version >= "3.10" and python_version < "3.13"
sqlalchemy==2.0.30 ; python_version >= "3.10" and python_version < "3.13"
sqlglot==23.17.0 ; python_version >= "3.10" and python_version < "4.0"
sqlglot==24.0.1 ; python_version >= "3.10" and python_version < "4.0"
stack-data==0.6.3 ; python_version >= "3.10" and python_version < "4.0"
statsmodels==0.14.2 ; python_version >= "3.10" and python_version < "3.13"
stdlib-list==0.10.0 ; python_version >= "3.10" and python_version < "4.0"
Expand Down