From fc2f2b12e3d642403f00aa618e88bd95ed7b39a9 Mon Sep 17 00:00:00 2001 From: Sylvain Lesage Date: Thu, 22 Aug 2024 16:38:12 +0200 Subject: [PATCH] show the traceback of the cause, it's clearer (#3042) * show the traceback of the cause, it's clearer * retry for backfill --- libs/libcommon/src/libcommon/constants.py | 1 + .../worker/src/worker/job_runners/config/parquet_and_info.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/libcommon/src/libcommon/constants.py b/libs/libcommon/src/libcommon/constants.py index 11305c8e8..35679390e 100644 --- a/libs/libcommon/src/libcommon/constants.py +++ b/libs/libcommon/src/libcommon/constants.py @@ -43,6 +43,7 @@ LARGE_MAX_FAILED_RUNS = 30 # for errors that should not be permanent MAX_FAILED_RUNS_PER_ERROR_CODE = { # default + "DatasetGenerationError": DEFAULT_MAX_FAILED_RUNS, # <- 20240822: to recompute all of them in the next backfill "ConfigNamesError": DEFAULT_MAX_FAILED_RUNS, # <- 20240822: to recompute all of them in the next backfill "RetryableConfigNamesError": DEFAULT_MAX_FAILED_RUNS, "ConnectionError": DEFAULT_MAX_FAILED_RUNS, diff --git a/services/worker/src/worker/job_runners/config/parquet_and_info.py b/services/worker/src/worker/job_runners/config/parquet_and_info.py index 2d2c8353b..a0a9d8d0a 100644 --- a/services/worker/src/worker/job_runners/config/parquet_and_info.py +++ b/services/worker/src/worker/job_runners/config/parquet_and_info.py @@ -1531,7 +1531,9 @@ def compute_config_parquet_and_info_response( except datasets.exceptions.DatasetGenerationCastError as err: raise DatasetGenerationCastError("The dataset generation failed because of a cast error", cause=err) from err except datasets.exceptions.DatasetGenerationError as err: - raise DatasetGenerationError("The dataset generation failed", cause=err) from err + if err.__cause__: + raise DatasetGenerationError("The dataset generation failed", cause=err.__cause__) from err + raise DatasetGenerationError("The dataset generation failed") from err raise_if_long_column_name(builder.info.features)