From c7b02049427ad209b0f121c614e37b129f3d285a Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Wed, 13 Mar 2024 05:43:50 -0500 Subject: [PATCH] ci: actually fix benchmarking (#8642) --- ibis/tests/benchmarks/test_benchmarks.py | 25 +++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/ibis/tests/benchmarks/test_benchmarks.py b/ibis/tests/benchmarks/test_benchmarks.py index 46c161a0e90f..5bf0db6a47c9 100644 --- a/ibis/tests/benchmarks/test_benchmarks.py +++ b/ibis/tests/benchmarks/test_benchmarks.py @@ -668,9 +668,9 @@ def test_snowflake_medium_sized_to_pandas(benchmark): # LINEITEM at scale factor 1 is around 6MM rows, but we limit to 1,000,000 # to make the benchmark fast enough for development, yet large enough to show a # difference if there's a performance hit - lineitem = con.table("LINEITEM", schema="SNOWFLAKE_SAMPLE_DATA.TPCH_SF1").limit( - 1_000_000 - ) + lineitem = con.table( + "LINEITEM", schema="TPCH_SF1", database="SNOWFLAKE_SAMPLE_DATA" + ).limit(1_000_000) benchmark.pedantic(lineitem.to_pandas, rounds=5, iterations=1, warmup_rounds=1) @@ -800,17 +800,14 @@ def test_big_join_expr(benchmark, src, diff): benchmark(ir.Table.join, src, diff, ["validation_name"], how="outer") -def test_big_join_compile(benchmark, nrels): - # cache to avoid a request-per-union operand - src = make_big_union( - ibis.table(schema={"validation_name": "string", "id": "int64"}, name="sources"), - nrels, - ) - - diff = make_big_union( - ibis.table(schema={"validation_name": "string"}, name="diffs"), nrels - ) +def test_big_join_compile(benchmark, src, diff): + pytest.importorskip("duckdb") expr = src.join(diff, ["validation_name"], how="outer") - t = benchmark.pedantic(expr.compile, rounds=1, iterations=1, warmup_rounds=1) + t = benchmark.pedantic( + lambda expr=expr: ibis.to_sql(expr, dialect="duckdb"), + rounds=1, + iterations=1, + warmup_rounds=1, + ) assert len(t)