Skip to content

Commit

Permalink
[MNT] Remind about missing value annotation in age parsing error (#402)
Browse files Browse the repository at this point in the history
* remind about missing values in age parsing error

* include original exception message in custom error
  • Loading branch information
alyssadai authored Dec 4, 2024
1 parent 8578e4c commit ad9066f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bagel/utilities/pheno_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ def transform_age(value: str, heuristic: str) -> float:
is_recognized_heuristic = False
except (ValueError, isodate.isoerror.ISO8601Error) as e:
raise ValueError(
f"There was a problem with applying the age transformation: {heuristic}. "
"Check that the specified transformation is correct for the age values in your data dictionary."
f"There was a problem with applying the age transformation: {heuristic}. Error: {str(e)}\n"
f"Check that the transformation specified in the data dictionary ({heuristic}) is correct for the age values in your phenotypic file, "
"and that you correctly annotated any missing values in your age column."
) from e
if not is_recognized_heuristic:
raise ValueError(
Expand Down

0 comments on commit ad9066f

Please sign in to comment.