Skip to content
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

Refine _time_to_search_dims logic #1561

Merged
merged 9 commits into from Mar 18, 2024
Merged

Refine _time_to_search_dims logic #1561

merged 9 commits into from Mar 18, 2024

Conversation

Ariana-B
Copy link
Contributor

@Ariana-B Ariana-B commented Mar 7, 2024

Reason for this pull request

Passing time as an int/float to dc.load was causing the query to return an unexpected date range due to the value being interpreted as seconds since epoch. Int/float is not documented as an accepted type for time in the first place and could be ambiguous.

Proposed changes

  • Raise error if time is not provided as some form of datetime or a string

  • Tweak and consolidate logic in _time_to_search_dims and _to_datetime

  • Remove added millisecond in time range from like as it appears unnecessary

  • Closes #xxxx

  • Tests added / passed

  • Fully documented, including docs/about/whats_new.rst for all changes


📚 Documentation preview 📚: https://datacube-core--1561.org.readthedocs.build/en/1561/

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.78%. Comparing base (b6cebf5) to head (4bf8cb8).

❗ Current head 4bf8cb8 differs from pull request most recent head 78948f5. Consider uploading reports for the commit 78948f5 to get more accurate results

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1561   +/-   ##
========================================
  Coverage    91.78%   91.78%           
========================================
  Files          132      132           
  Lines        14641    14621   -20     
========================================
- Hits         13438    13420   -18     
+ Misses        1203     1201    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@SpacemanPaul SpacemanPaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

datacube/api/query.py Outdated Show resolved Hide resolved
docs/about/whats_new.rst Outdated Show resolved Hide resolved
@Ariana-B Ariana-B merged commit 47b8d09 into develop Mar 18, 2024
30 checks passed
@Ariana-B Ariana-B deleted the fix_time_int_bug branch March 18, 2024 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants