-
Notifications
You must be signed in to change notification settings - Fork 37
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 timezones in feat info #958
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #958 +/- ##
==========================================
- Coverage 93.72% 93.71% -0.02%
==========================================
Files 43 43
Lines 6489 6478 -11
==========================================
- Hits 6082 6071 -11
Misses 407 407
|
@@ -845,7 +843,7 @@ def feature_info(args): | |||
if params.product.time_resolution.is_summary(): | |||
date_info["time"] = ds.time.begin.strftime("%Y-%m-%d") | |||
else: | |||
date_info["time"] = dataset_center_time(ds).strftime("%Y-%m-%d %H:%M:%S UTC") | |||
date_info["time"] = dataset_center_time(ds).strftime("%Y-%m-%d %H:%M:%S %Z") |
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.
This is the actual bug fix.
Sorry this has taken me a few days to test, but I had a few issues with out-of-date Helm API versions. I have now built and deployed a new version of datacube-ows and this fix didn't work. The reason is that I only want to show users dates, not datetimes, so I think the L843 fix might still be useful, but it looks like L844 is the issue in my case. For additional reference, see:
|
There are three allowed values for "time_resolution": "solar", "summary" and "subday". Of these, only "summary" returns true from See the documentation for time_resolution The time portion is suppressed for "summary" time resolution as it already assumed to always be You can write a user function to add e.g. a "capture_day" field to returned feature info JSON, but you can't suppress the time part of the dataset time if it exists in the index. The documentation for adding custom fields to feature into is here But there is a parallel bug in the update_ranges code that is causing the "advertised" solar dates to be off by one where the capture date is not indexed in UTC - I'll fix that now. |
… in update_ranges.
Can you update with the above commit and re-run |
Sorry yes, I misread. I will retest now. My update takes a bit over an hour (is that about normal with lots of data?), but will report back once it is done. |
ok, seems that this didn't fix it, but I don't quite understand why. I re-ran the update and cleared any caches (I think), but it is a bit difficult to test and debug on my end because I don't have a dev environment set up and it takes too long to process. I did previously have a dev environment, so I can see if I can get it back up and running... |
|
ok, thanks. I was just running the same job that I ran for adding new data and assumed that it was needed for this, but good to know that I only need the basic update. |
I haven't heard back from @JonDHo so I'm not sure if this is a complete fix, but it's definitely an improvement, so let's get it merged. |
Sorry, I haven’t managed to look deeper into it yet. The last fix didn’t fully resolve the issue but I can see that it is an improvement. I need to dig into the DB to try to work out whether it is at that level, in the ows layer or Terria. |
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.
It was in a different context (on web pages), but I didn't think Copyright notices required regularly updated dates.
data.py
)📚 Documentation preview 📚: https://datacube-ows--958.org.readthedocs.build/en/958/