-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support additional variable in PathBuilder #90
Conversation
* add protections for Publisher/Consumer using default exch or queue * setting prefetch_count must be done before calling basic_consume * re-order rabbitmq_utils classes and functions --------- Co-authored-by: Geary Layne <[email protected]>
Do these changes include the parse_args update from PR #85? I didn't see anything in the changed code that included catching the exception to calling this in parse_times with a malformed path? |
Paul, good call. I forgot that bug fix, I make sure it's covered |
@paulhamer-noaa, I looked into where you added the try/except. The code with in the 'try' was doing two things, 1) parsing the format string, and 2) extracting the variable from the provided path string. These two step are not separated. Parsing the format string is done on init or format updates, and this info is saved for later when extracting. If you have the example/test that used to break, I can make sure it works with the new code. |
Use any unittest for http_utils that use the MRMS return. The mrms_response includes a file with the name: MRMS_MergedReflectivityQC_00.50.latest.grib2.gz |
Locally I added this temporarily to the test_path_builder.py (with a few changed to path_builder.py) @fixture
def http_utils() -> PathBuilder:
EXAMPLE_BASE_DIR = 'http://127.0.0.1:5000/data/'
EXAMPLE_SUB_DIR = '3DRefl/MergedReflectivityQC_00.50/'
EXAMPLE_FILE_BASE = ('MRMS_MergedReflectivityQC_00.50_{issue.year:04d}{issue.month:02d}'
'{issue.day:02d}-{issue.hour:02d}{issue.minute:02d}{issue.second:02d}')
EXAMPLE_FILE_EXT = '.grib2.gz'
return PathBuilder(EXAMPLE_BASE_DIR, EXAMPLE_SUB_DIR, EXAMPLE_FILE_BASE, EXAMPLE_FILE_EXT)
def test_invalid_path_len(http_utils: PathBuilder):
path_with_invalid_struct = 'MRMS_MergedReflectivityQC_00.50.latest.grib2.gz'
http_utils.parse_filename(path_with_invalid_struct)
def test_invalid_path_type(http_utils: PathBuilder):
path_with_invalid_struct = 'MRMS_MergedReflectivityQC_00.50.abcdEFgh-IJklMN.grib2.gz'
http_utils.parse_filename(path_with_invalid_struct) and get this: So the problematic paths are handled, just not silently. I believe the try/except/pass code would not raise a exception to let the use know that there is a problem. Would it work for you to add a try/except/pass to code using path builder if the you need it to be silent? As a note, if path had both valid and invalid structure, I believe the try/except/pass code could act like everything was find. Say for a path like |
7440926
Sorry about pushing changes to your branch, Geary. I just caused merge conflicts in |
Linear Issue
IDSSE-836
Changes
Explanation
There are a few mostly unrelated changes to other class, but they are all small