Skip to content

Commit

Permalink
fix(deps): update dependency sqlglot to v23 (#8688)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Phillip Cloud <417981+cpcloud@users.noreply.github.com>
  • Loading branch information
renovate[bot] and cpcloud authored Mar 20, 2024
1 parent 82a4846 commit 5041894
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SELECT
mod(EXTRACT(dayofweek FROM DATE(2017, 1, 1)) + 5, 7) AS `DayOfWeekIndex_datetime_date_2017_ 1_ 1`
MOD(EXTRACT(dayofweek FROM DATE(2017, 1, 1)) + 5, 7) AS `DayOfWeekIndex_datetime_date_2017_ 1_ 1`
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SELECT
mod(EXTRACT(dayofweek FROM datetime('2017-01-01T04:55:59')) + 5, 7) AS `DayOfWeekIndex_datetime_datetime_2017_ 1_ 1_ 4_ 55_ 59`
MOD(EXTRACT(dayofweek FROM datetime('2017-01-01T04:55:59')) + 5, 7) AS `DayOfWeekIndex_datetime_datetime_2017_ 1_ 1_ 4_ 55_ 59`
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SELECT
mod(EXTRACT(dayofweek FROM DATE(2017, 1, 1)) + 5, 7) AS `DayOfWeekIndex_datetime_date_2017_ 1_ 1`
MOD(EXTRACT(dayofweek FROM DATE(2017, 1, 1)) + 5, 7) AS `DayOfWeekIndex_datetime_date_2017_ 1_ 1`
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SELECT
mod(EXTRACT(dayofweek FROM datetime('2017-01-01T04:55:59')) + 5, 7) AS `DayOfWeekIndex_datetime_datetime_2017_ 1_ 1_ 4_ 55_ 59`
MOD(EXTRACT(dayofweek FROM datetime('2017-01-01T04:55:59')) + 5, 7) AS `DayOfWeekIndex_datetime_datetime_2017_ 1_ 1_ 4_ 55_ 59`
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SELECT
mod(EXTRACT(dayofweek FROM datetime('2017-01-01T04:55:59')) + 5, 7) AS `DayOfWeekIndex_datetime_datetime_2017_ 1_ 1_ 4_ 55_ 59`
MOD(EXTRACT(dayofweek FROM datetime('2017-01-01T04:55:59')) + 5, 7) AS `DayOfWeekIndex_datetime_datetime_2017_ 1_ 1_ 4_ 55_ 59`
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SELECT
mod(EXTRACT(dayofweek FROM DATE(2017, 1, 1)) + 5, 7) AS `DayOfWeekIndex_datetime_date_2017_ 1_ 1`
MOD(EXTRACT(dayofweek FROM DATE(2017, 1, 1)) + 5, 7) AS `DayOfWeekIndex_datetime_date_2017_ 1_ 1`
4 changes: 3 additions & 1 deletion ibis/backends/druid/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class DruidCompiler(SQLGlotCompiler):
ops.BitwiseXor: "bitwise_xor",
ops.BitwiseLeftShift: "bitwise_shift_left",
ops.BitwiseRightShift: "bitwise_shift_right",
ops.Modulus: "mod",
ops.Power: "power",
ops.ApproxCountDistinct: "approx_count_distinct",
ops.StringContains: "contains_string",
Expand All @@ -98,6 +97,9 @@ def _aggregate(self, funcname: str, *args, where):
return sg.exp.Filter(this=expr, expression=sg.exp.Where(this=where))
return expr

def visit_Modulus(self, op, *, left, right):
return self.f.anon.mod(left, right)

def visit_Log10(self, op, *, arg):
return self.f.anon.log10(arg)

Expand Down
4 changes: 3 additions & 1 deletion ibis/backends/exasol/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ class ExasolCompiler(SQLGlotCompiler):

SIMPLE_OPS = {
ops.Log10: "log10",
ops.Modulus: "mod",
ops.All: "min",
ops.Any: "max",
}
Expand All @@ -119,6 +118,9 @@ def _gen_valid_name(name: str) -> str:
"""Exasol does not allow dots in quoted column names."""
return name.replace(".", "_")

def visit_Modulus(self, op, *, left, right):
return self.f.anon.mod(left, right)

def visit_NonNullLiteral(self, op, *, value, dtype):
if dtype.is_date():
return self.cast(value.isoformat(), dtype)
Expand Down
20 changes: 20 additions & 0 deletions ibis/backends/mssql/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,3 +457,23 @@ def visit_All(self, op, *, arg, where):
if where is not None:
arg = self.if_(where, arg, NULL)
return sge.Min(this=arg)

def visit_Select(self, op, *, parent, selections, predicates, sort_keys):
# if we've constructed a useless projection return the parent relation
if not selections and not predicates and not sort_keys:
return parent

result = parent

if selections:
result = sg.select(*self._cleanup_names(selections), copy=False).from_(
result, copy=False
)

if predicates:
result = result.where(*predicates, copy=True)

if sort_keys:
result = result.order_by(*sort_keys, copy=False)

return result
2 changes: 1 addition & 1 deletion ibis/backends/oracle/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def visit_Radians(self, op, *, arg):
return self.visit_node(ops.Pi()) * arg / 180

def visit_Modulus(self, op, *, left, right):
return self.f.mod(left, right)
return self.f.anon.mod(left, right)

def visit_Levenshtein(self, op, *, left, right):
# Not using FuncGen here because of dotted function call
Expand Down
4 changes: 3 additions & 1 deletion ibis/backends/sqlite/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class SQLiteCompiler(SQLGlotCompiler):
ops.ExtractUserInfo: "_ibis_extract_user_info",
ops.BitwiseXor: "_ibis_xor",
ops.BitwiseNot: "_ibis_inv",
ops.Modulus: "mod",
ops.TypeOf: "typeof",
ops.BitOr: "_ibis_bit_or",
ops.BitAnd: "_ibis_bit_and",
Expand Down Expand Up @@ -274,6 +273,9 @@ def visit_TimestampFromYMDHMS(
)
)

def visit_Modulus(self, op, *, left, right):
return self.f.anon.mod(left, right)

def _temporal_truncate(self, func, arg, unit):
modifiers = {
DateUnit.DAY: ("start of day",),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ LEFT OUTER JOIN (
AND "t1"."month" = CAST(2 AS TINYINT)
AND "t1"."day" = CAST(29 AS TINYINT)
) AS "t5"
ON "t4"."year" = "t5"."year" AND "t4"."month" = "t5"."month" AND "t4"."day" = "t5"."day"
ON "t4"."year" = "t5"."year"
AND "t4"."month" = "t5"."month"
AND "t4"."day" = "t5"."day"
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ FROM (
INNER JOIN "supplier" AS "t9"
ON "t8"."l_suppkey" = "t9"."s_suppkey"
INNER JOIN "nation" AS "t10"
ON "t6"."c_nationkey" = "t9"."s_nationkey" AND "t9"."s_nationkey" = "t10"."n_nationkey"
ON "t6"."c_nationkey" = "t9"."s_nationkey"
AND "t9"."s_nationkey" = "t10"."n_nationkey"
INNER JOIN "region" AS "t11"
ON "t10"."n_regionkey" = "t11"."r_regionkey"
) AS "t12"
Expand Down
10 changes: 5 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 = ">=22.5,<22.6"
sqlglot = ">=22.5,<23.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 @@ -235,7 +235,7 @@ sortedcontainers==2.4.0 ; python_version >= "3.9" 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.28 ; python_version >= "3.9" and python_version < "4.0"
sqlglot==22.5.0 ; python_version >= "3.9" and python_version < "4.0"
sqlglot==23.0.3 ; python_version >= "3.9" and python_version < "4.0"
stack-data==0.6.3 ; python_version >= "3.9" and python_version < "4.0"
statsmodels==0.14.1 ; python_version >= "3.10" and python_version < "3.13"
stdlib-list==0.10.0 ; python_version >= "3.9" and python_version < "4.0"
Expand Down

0 comments on commit 5041894

Please sign in to comment.