Simplify Stream Totaling for Staging Compatibility #2817
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
For reasons currently not understood, the namedtuple result of
sum_subbasin_stream_lengths
is interpreted as a dict by Celery when run locally, but as a list when run on staging.By outputting a dict always, we ensure that it is interpreted uniformly across platforms.
I've currently manually applied this patch on staging to get it to work.
Connects #2811
Demo
Staging woking with the patch:
Notes
I was unable to find out exactly why this was happening, but I did find some discussion on conflicting behavior of converting namedtuples to dicts here: https://stackoverflow.com/questions/26180528/python-named-tuple-to-dictionary. In the interest of expediency, I settled for a solution sans explanation. 馃殌馃惁
Testing Instructions
develop
, run subbasin HUC-10 locally and save the table data as a CSVbundle
vagrant ssh services -c 'redis-cli -n 1 --raw KEYS ":1:geop_*" | xargs redis-cli -n 1 DEL'