From 67d1515b70344d39fda8d4319100390fac4ecb5e Mon Sep 17 00:00:00 2001 From: Cheng Su Date: Wed, 8 Feb 2023 20:30:30 -0800 Subject: [PATCH] [Datasets] Fix sort nightly test to skip `stats()` if exception is raised (#32329) --- release/nightly_tests/dataset/sort.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/release/nightly_tests/dataset/sort.py b/release/nightly_tests/dataset/sort.py index 55d726f9c93cd..d47fe89221c9a 100644 --- a/release/nightly_tests/dataset/sort.py +++ b/release/nightly_tests/dataset/sort.py @@ -113,12 +113,14 @@ def make_block(count: int, num_columns: int) -> Block: num_columns=1, ) exc = None + ds_stats = None try: if args.shuffle: ds = ds.random_shuffle() else: ds = ds.sort(key="c_0") ds.fully_executed() + ds_stats = ds.stats() except Exception as e: exc = e pass @@ -143,7 +145,8 @@ def make_block(count: int, num_columns: int) -> Block: print(traceback.format_exc()) print("") - print(ds.stats()) + if ds_stats is not None: + print(ds_stats) if "TEST_OUTPUT_JSON" in os.environ: out_file = open(os.environ["TEST_OUTPUT_JSON"], "w")