diff options
author | Frederick Muriuki Muriithi | 2024-02-20 10:57:56 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-02-20 10:57:56 +0300 |
commit | ce243a57b24d6adecb169487e706290d91b22d19 (patch) | |
tree | 6b0b06a444c16ffb8be1c65fa4e5b78ced6a0615 /quality_control/checks.py | |
parent | a4324cd24b5a14fbcf19a6e04d2b76fb2838038e (diff) | |
download | gn-uploader-ce243a57b24d6adecb169487e706290d91b22d19.tar.gz |
Track filename in the errors
R/qtl2 bundles can contain more than one file, of the same type. When
errors are encountered in any of the files, we need to be able to
inform the user which file it is, in addition to the line and column
number.
Diffstat (limited to 'quality_control/checks.py')
-rw-r--r-- | quality_control/checks.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/quality_control/checks.py b/quality_control/checks.py index 475eb9e..bdfd12b 100644 --- a/quality_control/checks.py +++ b/quality_control/checks.py @@ -52,7 +52,8 @@ def decimal_places_pattern(mini: int, maxi: Optional[int] = None) -> re.Pattern: + r")$" ) -def decimal_points_error(lineno: int, +def decimal_points_error(filename: str,# pylint: disable=[too-many-arguments] + lineno: int, field: str, value: str, mini: int, @@ -61,7 +62,7 @@ def decimal_points_error(lineno: int, Check that 'value' in a decimal number with the appropriate decimal places. """ if not bool(decimal_places_pattern(mini, maxi).match(value)): - return InvalidValue(lineno, field, value, ( + return InvalidValue(filename, lineno, field, value, ( f"Invalid value '{value}'. Expected numerical value " + f"with at least {mini} decimal places" + (f" and at most {maxi} decimal places" if maxi is not None else "") |