AMF-FLX/AMF-BASE-QAQC

txt file with headers only throws exception in file_fixer

Opened this issue · 0 comments

A txt file with headers only (e.g., the test file US-CRT_HH_201101010000_201201010000_TestUSTARFiltering000003_headers.txt in the ustar_filtering testdata materials) throws an exception in the file_fixer.

[INFO] upload_checks - Traceback (most recent call last):
  File "/data/ameriflux/AMF-BASE-QAQC_test/processing/upload_checks.py", line 229, in upload_checks
    FileFixer().driver(
  File "/data/ameriflux/AMF-BASE-QAQC_test/processing/file_fixer.py", line 1453, in driver
    return ([StatusGenerator().split_status_generator(
  File "/data/ameriflux/AMF-BASE-QAQC_test/processing/status.py", line 1036, in split_status_generator
    sub_status[sub_name] = Status(status_code=s,
  File "/data/ameriflux/AMF-BASE-QAQC_test/processing/status.py", line 98, in __init__
    self._validate_status(status_code, qaqc_check, src_logger_name,
  File "/data/ameriflux/AMF-BASE-QAQC_test/processing/status.py", line 480, in _validate_status
    raise StatusException(err_msg)
status.StatusException: Number of warnings unspecified for status code WARNING

NOTE: This is an edge case and unlikely to be seen.

Expected behavior
File is unfixable and file_fixer should fail to autocorrect gracefully and upload_checks complete.

Additional context

  • System info: discovered on the dev system (python 3.10) by @toanngosy.