Skip to content

Commit

Permalink
test(clickhouse): add test case for inserting a pyarrow table (#10288)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored Oct 9, 2024
1 parent 7fd710c commit 7d98330
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ibis/backends/clickhouse/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,17 @@ def temporary_alltypes(con):
con.drop_table(table)


def test_insert(con, temporary_alltypes, df):
@pytest.mark.parametrize(
"transform",
[param(lambda df: df, id="pandas"), param(pa.Table.from_pandas, id="pyarrow")],
)
def test_insert(con, temporary_alltypes, df, transform):
temporary = temporary_alltypes
records = df[:10]

assert temporary.count().execute() == 0
con.insert(temporary.op().name, records)

con.insert(temporary.op().name, transform(records))

tm.assert_frame_equal(temporary.execute(), records)

Expand Down

0 comments on commit 7d98330

Please sign in to comment.