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

Remove common_timestamp function from postgis driver #1623

Merged
merged 11 commits into from
Sep 20, 2024

Conversation

SpacemanPaul
Copy link
Contributor

Reason for this pull request

The common_timestamp custom postgresql function was previously used in both postgis and postgres index drivers to ensure correct timezone handling when inserting and extracting time data. The use of this function significantly complicated efficient indexing of time fields in both drivers.

With SQLAlchemy2, most of the functionality of the common_timestamp function can be handled with a simple type cast. Some complexities regarding handling of:

a) data with no explicit timezone marker,
b) databases with a default timezone other than UTC, and
c) the "find duplicates with time" method

necessitated some further internal restructure and changes to internal APIs.

Due to these complexities, I have only applied these changes to the postgis driver.

Copy link

codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 85.24%. Comparing base (eeb5e6d) to head (06b3606).

Files with missing lines Patch % Lines
datacube/drivers/postgis/_api.py 92.10% 3 Missing ⚠️
datacube/drivers/postgis/_fields.py 93.47% 3 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           develop-1.9    #1623      +/-   ##
===============================================
+ Coverage        85.23%   85.24%   +0.01%     
===============================================
  Files              144      144              
  Lines            15633    15685      +52     
===============================================
+ Hits             13325    13371      +46     
- Misses            2308     2314       +6     

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

@SpacemanPaul SpacemanPaul marked this pull request as ready for review August 30, 2024 01:04
datacube/drivers/postgis/_api.py Show resolved Hide resolved
datacube/drivers/postgis/_api.py Outdated Show resolved Hide resolved
datacube/drivers/postgis/_fields.py Outdated Show resolved Hide resolved
@SpacemanPaul SpacemanPaul merged commit 2824c16 into develop-1.9 Sep 20, 2024
24 of 28 checks passed
@SpacemanPaul SpacemanPaul deleted the rem-common-ts branch September 20, 2024 05:32
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.

3 participants