Skip to content

Commit

Permalink
fix(deps): update dependency sqlglot to >=23.4,<25.12 (#9834)
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 Aug 15, 2024
1 parent 3780a13 commit 69a10d9
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 14 deletions.
4 changes: 2 additions & 2 deletions ibis/backends/duckdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from ibis.backends import CanCreateDatabase, CanCreateSchema, UrlFromPath
from ibis.backends.duckdb.converter import DuckDBPandasData
from ibis.backends.sql import SQLBackend
from ibis.backends.sql.compilers.base import STAR, C
from ibis.backends.sql.compilers.base import STAR, AlterTable, C
from ibis.common.dispatch import lazy_singledispatch
from ibis.expr.operations.udf import InputType
from ibis.util import deprecated
Expand Down Expand Up @@ -236,7 +236,7 @@ def create_table(
)
else:
cur.execute(
sge.AlterTable(
AlterTable(
this=initial_table,
actions=[sge.RenameTable(this=final_table)],
).sql(self.name)
Expand Down
7 changes: 3 additions & 4 deletions ibis/backends/pyspark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from ibis.backends.pyspark.converter import PySparkPandasData
from ibis.backends.pyspark.datatypes import PySparkSchema, PySparkType
from ibis.backends.sql import SQLBackend
from ibis.backends.sql.compilers.base import AlterTable
from ibis.expr.operations.udf import InputType
from ibis.legacy.udf.vectorized import _coerce_to_series
from ibis.util import deprecated
Expand Down Expand Up @@ -659,10 +660,8 @@ def rename_table(self, old_name: str, new_name: str) -> None:
"""
old = sg.table(old_name, quoted=True)
new = sg.table(new_name, quoted=True)
query = sge.AlterTable(
this=old,
exists=False,
actions=[sge.RenameTable(this=new, exists=True)],
query = AlterTable(
this=old, exists=False, actions=[sge.RenameTable(this=new, exists=True)]
)
with self._safe_raw_sql(query):
pass
Expand Down
10 changes: 10 additions & 0 deletions ibis/backends/sql/compilers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@
from ibis.expr.operations.udf import InputType
from ibis.expr.rewrites import lower_stringslice

try:
from sqlglot.expressions import Alter
except ImportError:
from sqlglot.expressions import AlterTable
else:

def AlterTable(*args, kind="TABLE", **kwargs):
return Alter(*args, kind=kind, **kwargs)


if TYPE_CHECKING:
from collections.abc import Callable, Iterable, Mapping

Expand Down
4 changes: 2 additions & 2 deletions ibis/backends/trino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from ibis import util
from ibis.backends import CanCreateDatabase, CanCreateSchema, CanListCatalog
from ibis.backends.sql import SQLBackend
from ibis.backends.sql.compilers.base import C
from ibis.backends.sql.compilers.base import AlterTable, C

if TYPE_CHECKING:
from collections.abc import Iterator, Mapping
Expand Down Expand Up @@ -514,7 +514,7 @@ def create_table(

# rename the new table to the original table name
cur.execute(
sge.AlterTable(
AlterTable(
this=table_ref,
exists=True,
actions=[sge.RenameTable(this=orig_table_ref, exists=True)],
Expand Down
8 changes: 4 additions & 4 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 @@ -41,7 +41,7 @@ atpublic = ">=2.3,<6"
parsy = ">=2,<3"
python-dateutil = ">=2.8.2,<3"
pytz = ">=2022.7"
sqlglot = ">=23.4,<25.11"
sqlglot = ">=23.4,<25.12"
toolz = ">=0.11,<1"
typing-extensions = ">=4.3.0,<5"
numpy = { version = ">=1.23.2,<3", 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 @@ -257,7 +257,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.1 ; python_version >= "3.10" and python_version < "3.13"
sqlalchemy==2.0.32 ; python_version >= "3.10" and python_version < "3.13"
sqlglot==25.10.0 ; python_version >= "3.10" and python_version < "4.0"
sqlglot==25.11.0 ; 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"
tabulate==0.9.0 ; python_version >= "3.10" and python_version < "3.13"
Expand Down

0 comments on commit 69a10d9

Please sign in to comment.