Skip to content

Commit 4ea393e

Browse files
authored
Merge branch 'main' into fix/allow-skipping-memtable_volume-creation-with-databricks
2 parents 9080b2a + 23e661b commit 4ea393e

File tree

14 files changed

+59
-80
lines changed

14 files changed

+59
-80
lines changed

.github/workflows/check-generated-files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
cache-dependency-path: requirements-dev.txt
4545

4646
- name: install uv
47-
uses: astral-sh/[email protected].1
47+
uses: astral-sh/[email protected].2
4848

4949
- name: update apt-get
5050
run: sudo apt-get update -y -q

.github/workflows/ibis-backends-cloud.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
python-version: ${{ matrix.python-version }}
131131

132132
- name: install uv
133-
uses: astral-sh/[email protected].1
133+
uses: astral-sh/[email protected].2
134134

135135
- name: install additional deps
136136
if: matrix.backend.key == 'snowpark'

.github/workflows/ibis-backends.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
python-version: ${{ matrix.python-version }}
6666

6767
- name: install uv
68-
uses: astral-sh/[email protected].1
68+
uses: astral-sh/[email protected].2
6969

7070
- uses: extractions/setup-just@v3
7171
env:
@@ -498,7 +498,7 @@ jobs:
498498
python-version: ${{ matrix.python-version }}
499499

500500
- name: install uv
501-
uses: astral-sh/[email protected].1
501+
uses: astral-sh/[email protected].2
502502

503503
- name: install other deps
504504
if: matrix.backend.additional_deps != null
@@ -612,7 +612,7 @@ jobs:
612612
python-version: ${{ matrix.python-version }}
613613

614614
- name: install uv
615-
uses: astral-sh/[email protected].1
615+
uses: astral-sh/[email protected].2
616616

617617
# it requires a version of pandas that pyspark is not compatible with
618618
- name: remove lonboard

.github/workflows/ibis-benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
python-version: "3.13"
3434

3535
- name: install uv
36-
uses: astral-sh/[email protected].1
36+
uses: astral-sh/[email protected].2
3737

3838
- uses: extractions/setup-just@v3
3939
env:

.github/workflows/ibis-main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
python-version: ${{ matrix.python-version }}
6767

6868
- name: install uv
69-
uses: astral-sh/[email protected].1
69+
uses: astral-sh/[email protected].2
7070

7171
- name: install ${{ matrix.os }} system dependencies
7272
if: startsWith(matrix.os, 'ubuntu')
@@ -121,7 +121,7 @@ jobs:
121121
python-version: "3.9"
122122

123123
- name: install uv
124-
uses: astral-sh/[email protected].1
124+
uses: astral-sh/[email protected].2
125125

126126
- name: install system dependencies
127127
run: |
@@ -146,7 +146,7 @@ jobs:
146146
python-version: "3.13"
147147

148148
- name: install uv
149-
uses: astral-sh/[email protected].1
149+
uses: astral-sh/[email protected].2
150150

151151
- name: check duckdb doesn't import sqlite3
152152
run: uv run --extra duckdb python -c 'import sys, ibis; assert "sqlite3" not in sys.modules; ibis.duckdb.connect(); assert "sqlite3" not in sys.modules'
@@ -164,7 +164,7 @@ jobs:
164164
python-version: "3.13"
165165

166166
- name: install uv
167-
uses: astral-sh/[email protected].1
167+
uses: astral-sh/[email protected].2
168168

169169
- name: check scrapy import
170170
run: uv run --with scrapy python -c 'import scrapy; import ibis'
@@ -196,7 +196,7 @@ jobs:
196196
python-version: "3.13"
197197

198198
- name: install uv
199-
uses: astral-sh/[email protected].1
199+
uses: astral-sh/[email protected].2
200200

201201
- uses: extractions/setup-just@v3
202202
env:

.github/workflows/pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
python-version: "3.13"
3434

3535
- name: install uv
36-
uses: astral-sh/[email protected].1
36+
uses: astral-sh/[email protected].2
3737

3838
- uses: extractions/setup-just@v3
3939
env:

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
clickhouse:
3-
image: clickhouse/clickhouse-server:25.9.3.48-alpine
3+
image: clickhouse/clickhouse-server:25.9.4.58-alpine
44
ports:
55
- 8123:8123 # http port
66
- 9000:9000 # native protocol port

ibis/backends/duckdb/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,11 @@ def create_table(
180180
catalog = "temp"
181181
database = "main"
182182

183+
in_memory = False
183184
if obj is not None:
184185
if not isinstance(obj, ir.Expr):
185186
table = ibis.memtable(obj)
187+
in_memory = True
186188
else:
187189
table = obj
188190

@@ -233,6 +235,13 @@ def create_table(
233235
).sql(dialect)
234236
cur.execute(insert_stmt).fetchall()
235237

238+
if in_memory:
239+
cur.execute(
240+
sge.Drop(kind="VIEW", this=table.get_name(), exists=True).sql(
241+
dialect
242+
)
243+
)
244+
236245
if overwrite:
237246
cur.execute(
238247
sge.Drop(kind="TABLE", this=final_table, exists=True).sql(dialect)

ibis/backends/duckdb/tests/test_client.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,18 @@ def test_create_temp_table_in_nondefault_schema():
468468
con.con.execute(f"USE {database}")
469469
con.create_table("foo", {"id": [1, 2, 3]}, temp=True)
470470

471+
assert not con.list_tables(database=database) and not con.list_tables()
472+
assert con.list_tables(database="main") == ["foo"]
473+
474+
475+
@pytest.mark.parametrize("temp", [False, True])
476+
def test_create_table_from_in_memory_data(temp):
477+
con = ibis.duckdb.connect()
478+
con.create_table("foo", pd.DataFrame({"id": [1, 2, 3]}), temp=temp)
479+
480+
assert con.list_tables() == ["foo"]
481+
assert con.con.execute("SHOW TABLES").fetchall() == [("foo",)]
482+
471483

472484
def test_create_table_with_quoted_columns():
473485
con = ibis.duckdb.connect()
@@ -476,6 +488,7 @@ def test_create_table_with_quoted_columns():
476488
{"group": ["G1"], "value": ["E1"], "id": [1], "date": [datetime(2025, 5, 13)]}
477489
)
478490
con.create_table(name, df, temp=True)
491+
assert con.list_tables() == [name]
479492

480493

481494
def test_create_table_with_out_of_order_columns(con):

ibis/expr/decompile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
ops.ExtractMicrosecond: "microsecond",
2525
ops.ExtractMillisecond: "millisecond",
2626
ops.ExtractMinute: "minute",
27-
ops.ExtractMinute: "minute",
2827
ops.ExtractMonth: "month",
2928
ops.ExtractQuarter: "quarter",
3029
ops.ExtractSecond: "second",
@@ -38,6 +37,7 @@
3837
ops.StringContains: "contains",
3938
ops.StringSQLILike: "ilike",
4039
ops.StringSQLLike: "like",
40+
ops.Uppercase: "upper",
4141
}
4242

4343

0 commit comments

Comments
 (0)