-
Notifications
You must be signed in to change notification settings - Fork 9
fix message from post #225
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
fix message from post #225
Conversation
| # If getting extents fails, fall back to single-threaded mode | ||
| print( | ||
| f"WARNING: Could not retrieve time series extents ({e}). Falling back to single-threaded mode." | ||
| logging.debug( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would actually call this an error instead of debug because it means the timeseries extents is failing for some reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be an error, but the request still goes through. it just doesn't use the multithread. so I don't want an error message to appear if the request completes. If we killed the entire request then yes we would put error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good
|
|
||
| # Assert the expected values | ||
| assert chunks == 5, f"Expected 5 chunks, but got {chunks}" | ||
| assert threads == 5, f"Expected 5 threads, but got {threads}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to still test for the number of threads or call it good since we've tested it already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think a logging message should be used for a test. It might be a test of the individual function it self that chunks the data. run a test for chunk_timeseries_data. to make sure that it provides the data chunked correctly. actually that should be what we do...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Maybe the actual threads should be a separate function too and tested.
|
The multi-threading changes looks good, just a couple comments. I didn't look close at the api changes. |
perrymanmd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just cleaning up some change from print to logging.
cwms/timeseries/timeseries.py
Outdated
| chunk_start, chunk_end = future_to_chunk[future] | ||
| print( | ||
| logging.error( | ||
| f"ERROR: Failed to fetch data from {chunk_start} to {chunk_end}: {e}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove "ERROR: " and let the logging level handle it.
cwms/timeseries/timeseries.py
Outdated
| actual_workers = min(max_workers, len(chunks)) | ||
| print( | ||
| logging.debug( | ||
| f"INFO: Storing {len(chunks)} chunks of timeseries data with {actual_workers} threads" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove "INFO: " and let the logging level handle it.
…meseries-post-return
…st-return' of https://github.com/HydrologicEngineeringCenter/cwms-python into 202-apipy-errors-when-decoding-successful-timeseries-post-return
|



fix message from posting
change print statements from timeseries store/get to logging