HydrologicEngineeringCenter / HydrologicEngineeringCenter/cwms-python
store_timeseries fails if version datetime has unspecified timezone
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 16
- Forks
- 11
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 8
Description
If a timeseries version is not a datetime object that has a specified timezone, the store will fail because there is no "Z" at the end.
May want to consider putting a check in the timeseries_df_to_json function that checks if the datetime object has a timezone specified and throw an error or assume UTC.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in cwms/timeseries/timeseries.py at the timeseries_df_to_json function around lines 250-253. Reproduce store_timeseries with a version datetime that has no timezone, then determine and document whether the completed behavior should reject it or assume UTC. Done means the store no longer fails silently because the serialized version lacks the expected timezone marker.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100