Skip to content

Commit

Permalink
fix: add leading zero for sorting filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
richtia committed Sep 12, 2024
1 parent 219eb46 commit c192b53
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ TPCH_QUERY_TESTS = (
"test_name": "test_tpch_sql_1",
"file_names": ["lineitem.parquet"],
"sql_query": get_sql("q1.sql"),
"substrait_query": get_substrait_plan("query_1_plan.json"),
"substrait_query": get_substrait_plan("query_01_plan.json"),
},
{
"test_name": "test_tpch_sql_2",
Expand All @@ -116,7 +116,7 @@ TPCH_QUERY_TESTS = (
"region.parquet",
],
"sql_query": get_sql("q2.sql"),
"substrait_query": get_substrait_plan("query_2_plan.json"),
"substrait_query": get_substrait_plan("query_02_plan.json"),
},
]
```
Expand Down
18 changes: 9 additions & 9 deletions substrait_consumer/tests/integration/queries/tpch_test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"test_name": "test_tpch_sql_1",
"file_names": ["lineitem.parquet"],
"sql_query": get_sql("q1.sql"),
"substrait_query": get_substrait_plan("query_1_plan.json"),
"substrait_query": get_substrait_plan("query_01_plan.json"),
},
{
"test_name": "test_tpch_sql_2",
Expand All @@ -21,7 +21,7 @@
"region.parquet",
],
"sql_query": get_sql("q2.sql"),
"substrait_query": get_substrait_plan("query_2_plan.json"),
"substrait_query": get_substrait_plan("query_02_plan.json"),
},
{
"test_name": "test_tpch_sql_3",
Expand All @@ -31,13 +31,13 @@
"orders.parquet",
],
"sql_query": get_sql("q3.sql"),
"substrait_query": get_substrait_plan("query_3_plan.json"),
"substrait_query": get_substrait_plan("query_03_plan.json"),
},
{
"test_name": "test_tpch_sql_4",
"file_names": ["orders.parquet", "lineitem.parquet"],
"sql_query": get_sql("q4.sql"),
"substrait_query": get_substrait_plan("query_4_plan.json"),
"substrait_query": get_substrait_plan("query_04_plan.json"),
},
{
"test_name": "test_tpch_sql_5",
Expand All @@ -50,13 +50,13 @@
"region.parquet",
],
"sql_query": get_sql("q5.sql"),
"substrait_query": get_substrait_plan("query_5_plan.json"),
"substrait_query": get_substrait_plan("query_05_plan.json"),
},
{
"test_name": "test_tpch_sql_6",
"file_names": ["lineitem.parquet"],
"sql_query": get_sql("q6.sql"),
"substrait_query": get_substrait_plan("query_6_plan.json"),
"substrait_query": get_substrait_plan("query_06_plan.json"),
},
{
"test_name": "test_tpch_sql_7",
Expand All @@ -69,7 +69,7 @@
"nation.parquet",
],
"sql_query": get_sql("q7.sql"),
"substrait_query": get_substrait_plan("query_7_plan.json"),
"substrait_query": get_substrait_plan("query_07_plan.json"),
},
{
"test_name": "test_tpch_sql_8",
Expand All @@ -84,7 +84,7 @@
"region.parquet",
],
"sql_query": get_sql("q8.sql"),
"substrait_query": get_substrait_plan("query_8_plan.json"),
"substrait_query": get_substrait_plan("query_08_plan.json"),
},
{
"test_name": "test_tpch_sql_9",
Expand All @@ -97,7 +97,7 @@
"nation.parquet",
],
"sql_query": get_sql("q9.sql"),
"substrait_query": get_substrait_plan("query_9_plan.json"),
"substrait_query": get_substrait_plan("query_09_plan.json"),
},
{
"test_name": "test_tpch_sql_10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_isthmus_substrait_plan_generation(
substrait_query = producer.produce_substrait(sql_query)

snapshot.snapshot_dir = PLAN_SNAPSHOT_DIR
tpch_num = test_name.split("_")[-1]
tpch_num = test_name.split("_")[-1].zfill(2)
snapshot.assert_match(str(substrait_query), f"query_{tpch_num}_plan.json")

@custom_parametrization(TPCH_QUERY_TESTS)
Expand Down

0 comments on commit c192b53

Please sign in to comment.