Skip to content

Commit

Permalink
Rename tests for alphabetical ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikmakait committed Aug 15, 2024
1 parent de61121 commit 85b3041
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
18 changes: 9 additions & 9 deletions tests/tpch/dask_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import dask.dataframe as dd


def query_1(dataset_path, fs, scale):
def query_01(dataset_path, fs, scale):
VAR1 = datetime(1998, 9, 2)
lineitem_ds = dd.read_parquet(dataset_path + "lineitem", filesystem=fs)

Expand Down Expand Up @@ -40,7 +40,7 @@ def query_1(dataset_path, fs, scale):
return total.reset_index().sort_values(["l_returnflag", "l_linestatus"])


def query_2(dataset_path, fs, scale):
def query_02(dataset_path, fs, scale):
var1 = 15
var2 = "BRASS"
var3 = "EUROPE"
Expand Down Expand Up @@ -109,7 +109,7 @@ def query_2(dataset_path, fs, scale):
)


def query_3(dataset_path, fs, scale):
def query_03(dataset_path, fs, scale):
var1 = datetime.strptime("1995-03-15", "%Y-%m-%d")
var2 = "BUILDING"

Expand Down Expand Up @@ -138,7 +138,7 @@ def query_3(dataset_path, fs, scale):
)


def query_4(dataset_path, fs, scale):
def query_04(dataset_path, fs, scale):
date1 = datetime.strptime("1993-10-01", "%Y-%m-%d")
date2 = datetime.strptime("1993-07-01", "%Y-%m-%d")

Expand All @@ -162,7 +162,7 @@ def query_4(dataset_path, fs, scale):
return result_df


def query_5(dataset_path, fs, scale):
def query_05(dataset_path, fs, scale):
date1 = datetime.strptime("1994-01-01", "%Y-%m-%d")
date2 = datetime.strptime("1995-01-01", "%Y-%m-%d")

Expand Down Expand Up @@ -191,7 +191,7 @@ def query_5(dataset_path, fs, scale):
return gb.reset_index().sort_values("revenue", ascending=False)


def query_6(dataset_path, fs, scale):
def query_06(dataset_path, fs, scale):
date1 = datetime.strptime("1994-01-01", "%Y-%m-%d")
date2 = datetime.strptime("1995-01-01", "%Y-%m-%d")
var3 = 24
Expand All @@ -211,7 +211,7 @@ def query_6(dataset_path, fs, scale):
return revenue.sum().to_frame("revenue")


def query_7(dataset_path, fs, scale):
def query_07(dataset_path, fs, scale):
var1 = datetime.strptime("1995-01-01", "%Y-%m-%d")
var2 = datetime.strptime("1997-01-01", "%Y-%m-%d")

Expand Down Expand Up @@ -306,7 +306,7 @@ def query_7(dataset_path, fs, scale):
)


def query_8(dataset_path, fs, scale):
def query_08(dataset_path, fs, scale):
var1 = datetime.strptime("1995-01-01", "%Y-%m-%d")
var2 = datetime.strptime("1997-01-01", "%Y-%m-%d")

Expand Down Expand Up @@ -364,7 +364,7 @@ def query_8(dataset_path, fs, scale):
return final.sort_values(by=["o_year"], ascending=[True])[["o_year", "mkt_share"]]


def query_9(dataset_path, fs, scale):
def query_09(dataset_path, fs, scale):
"""
select
nation,
Expand Down
2 changes: 1 addition & 1 deletion tests/tpch/test_correctness.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,6 @@ def test_dask_results(
):
from . import dask_queries

func = getattr(dask_queries, f"query_{query}")
func = getattr(dask_queries, f"query_{query:02d}")
result = func(dataset_path, None, scale).compute()
verify_result(result, query, answers_path, s3_storage_options)
18 changes: 9 additions & 9 deletions tests/tpch/test_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,46 +23,46 @@ def dataset_path(local, scale):

@pytest.mark.shuffle_p2p
def test_query_1(client, dataset_path, fs, scale):
dask_queries.query_1(dataset_path, fs, scale).compute()
dask_queries.query_01(dataset_path, fs, scale).compute()


@pytest.mark.shuffle_p2p
def test_query_2(client, dataset_path, fs, scale):
dask_queries.query_2(dataset_path, fs, scale).compute()
dask_queries.query_02(dataset_path, fs, scale).compute()


@pytest.mark.shuffle_p2p
def test_query_3(client, dataset_path, fs, scale):
dask_queries.query_3(dataset_path, fs, scale).compute()
dask_queries.query_03(dataset_path, fs, scale).compute()


@pytest.mark.shuffle_p2p
def test_query_4(client, dataset_path, fs, scale):
dask_queries.query_4(dataset_path, fs, scale).compute()
dask_queries.query_04(dataset_path, fs, scale).compute()


@pytest.mark.shuffle_p2p
def test_query_5(client, dataset_path, fs, scale):
dask_queries.query_5(dataset_path, fs, scale).compute()
dask_queries.query_05(dataset_path, fs, scale).compute()


def test_query_6(client, dataset_path, fs, scale):
dask_queries.query_6(dataset_path, fs, scale).compute()
dask_queries.query_06(dataset_path, fs, scale).compute()


@pytest.mark.shuffle_p2p
def test_query_7(client, dataset_path, fs, scale):
dask_queries.query_7(dataset_path, fs, scale).compute()
dask_queries.query_07(dataset_path, fs, scale).compute()


@pytest.mark.shuffle_p2p
def test_query_8(client, dataset_path, fs, scale):
dask_queries.query_8(dataset_path, fs, scale).compute()
dask_queries.query_08(dataset_path, fs, scale).compute()


@pytest.mark.shuffle_p2p
def test_query_9(client, dataset_path, fs, scale):
dask_queries.query_9(dataset_path, fs, scale).compute()
dask_queries.query_09(dataset_path, fs, scale).compute()


@pytest.mark.shuffle_p2p
Expand Down
4 changes: 2 additions & 2 deletions tests/tpch/test_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ def query(request):


def test_optimization(query, dataset_path, fs, client, scale):
func = getattr(dask_queries, f"query_{query}")
func = getattr(dask_queries, f"query_{query:02d}")
result = func(dataset_path, fs, scale)
# We need to inject .repartition(npartitions=1) which .compute() does under the hood
result.repartition(npartitions=1).optimize()


def test_delay_computation_start(query, dataset_path, fs, client, scale):
func = getattr(dask_queries, f"query_{query}")
func = getattr(dask_queries, f"query_{query:02d}")
result = func(dataset_path, fs, scale).optimize()
# Client.compute unblocks as soon as update_graph finishes, i.e. graph is
# submitted and parsed. This is the time until the dashboard kicks off
Expand Down

0 comments on commit 85b3041

Please sign in to comment.