From 7e1ece7d3fd41d1e3ee38e479c119494bb269966 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Wed, 11 Oct 2023 13:18:29 -0400 Subject: [PATCH] test(clickhouse): add test for clickhouse-specific `create_table` parameters --- ibis/backends/clickhouse/tests/test_client.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ibis/backends/clickhouse/tests/test_client.py b/ibis/backends/clickhouse/tests/test_client.py index 678683d344f9..c4e2aec3bd24 100644 --- a/ibis/backends/clickhouse/tests/test_client.py +++ b/ibis/backends/clickhouse/tests/test_client.py @@ -224,6 +224,21 @@ def test_create_table_data(con, data, engine, temp_table): assert len(t.execute()) == 3 +def test_create_table_with_properties(con, temp_table): + data = pd.DataFrame({"a": list("abcde" * 20), "b": [1, 2, 3, 4, 5] * 20}) + n = len(data) + t = con.create_table( + temp_table, + data, + schema=ibis.schema(dict(a="string", b="!uint32")), + order_by=["a", "b"], + partition_by=["a"], + sample_by=["b"], + settings={"allow_nullable_key": "1"}, + ) + assert t.count().execute() == n + + @pytest.mark.parametrize( "engine", [