Skip to content

Commit

Permalink
fix(deps): update dependency sqlglot to v22
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and cpcloud committed Mar 12, 2024
1 parent b77aeec commit 8aa4222
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 18 deletions.
5 changes: 4 additions & 1 deletion ibis/backends/bigquery/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ def visit_BoundingBox(self, op, *, arg):

visit_GeoXMax = visit_GeoXMin = visit_GeoYMax = visit_GeoYMin = visit_BoundingBox

def visit_ArrayStringJoin(self, op, *, arg, sep):
return self.f.anon.array_to_string(arg, sep)

def visit_GeoSimplify(self, op, *, arg, tolerance, preserve_collapsed):
if (
not isinstance(op.preserve_collapsed, ops.Literal)
Expand Down Expand Up @@ -233,7 +236,7 @@ def visit_StrRight(self, op, *, arg, nchars):
return self.f.substr(arg, -self.f.least(self.f.length(arg), nchars))

def visit_StringJoin(self, op, *, arg, sep):
return self.f.array_to_string(self.f.array(*arg), sep)
return self.f.anon.array_to_string(self.f.array(*arg), sep)

def visit_DayOfWeekIndex(self, op, *, arg):
return self.f.mod(self.f.extract(self.v.dayofweek, arg) + 5, 7)
Expand Down
14 changes: 7 additions & 7 deletions ibis/backends/pyspark/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import ibis.common.exceptions as com
import ibis.expr.datatypes as dt
import ibis.expr.operations as ops
from ibis.backends.sql.compiler import FALSE, NULL, STAR, TRUE, SQLGlotCompiler
from ibis.backends.sql.compiler import FALSE, NULL, STAR, SQLGlotCompiler
from ibis.backends.sql.datatypes import PySparkType
from ibis.backends.sql.dialects import PySpark
from ibis.backends.sql.rewrites import FirstValue, LastValue, p
Expand Down Expand Up @@ -223,28 +223,28 @@ def visit_CountDistinctStar(self, op, *, arg, where):
return self.f.count(sge.Distinct(expressions=cols))

def visit_FirstValue(self, op, *, arg):
return self.f.first(arg, TRUE)
return sge.IgnoreNulls(this=self.f.first(arg))

def visit_LastValue(self, op, *, arg):
return self.f.last(arg, TRUE)
return sge.IgnoreNulls(this=self.f.last(arg))

def visit_First(self, op, *, arg, where):
if where is not None:
arg = self.if_(where, arg, NULL)
return self.f.first(arg, TRUE)
return sge.IgnoreNulls(this=self.f.first(arg))

def visit_Last(self, op, *, arg, where):
if where is not None:
arg = self.if_(where, arg, NULL)
return self.f.last(arg, TRUE)
return sge.IgnoreNulls(this=self.f.last(arg))

def visit_Arbitrary(self, op, *, arg, how, where):
if where is not None:
arg = self.if_(where, arg, NULL)
if how == "first":
return self.f.first(arg, TRUE)
return sge.IgnoreNulls(this=self.f.first(arg))
elif how == "last":
return self.f.last(arg, TRUE)
return sge.IgnoreNulls(this=self.f.last(arg))
else:
raise com.UnsupportedOperationError(
f"PySpark backend does not support arbitrary with how={how}. "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ WITH `t5` AS (
`t2`.`field_of_study`,
`t2`.`years`,
`t2`.`degrees`,
first_value(`t2`.`degrees`) OVER (PARTITION BY `t2`.`field_of_study` ORDER BY `t2`.`years` ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS `earliest_degrees`,
last_value(`t2`.`degrees`) OVER (PARTITION BY `t2`.`field_of_study` ORDER BY `t2`.`years` ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS `latest_degrees`
FIRST_VALUE(`t2`.`degrees`) OVER (PARTITION BY `t2`.`field_of_study` ORDER BY `t2`.`years` ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS `earliest_degrees`,
LAST_VALUE(`t2`.`degrees`) OVER (PARTITION BY `t2`.`field_of_study` ORDER BY `t2`.`years` ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS `latest_degrees`
FROM (
SELECT
`t1`.`field_of_study`,
Expand Down
12 changes: 6 additions & 6 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 = ">=19.3.0,<=20.11"
sqlglot = ">=22,<22.4"
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==20.11.0 ; python_version >= "3.9" and python_version < "4.0"
sqlglot==22.3.1 ; 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 8aa4222

Please sign in to comment.