Skip to content

Conversation

@b-j-karl
Copy link
Contributor

No description provided.

@b-j-karl b-j-karl requested a review from Copilot November 10, 2025 03:30
@b-j-karl b-j-karl linked an issue Nov 10, 2025 that may be closed by this pull request
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a GeoPackage hashing instability issue by normalizing the last_change timestamp in GPKG files to Unix epoch. The GeoPackage format stores a last_change timestamp in the gpkg_contents table, which was causing identical GeoDataFrames written at different times to produce different hashes, breaking content-based versioning.

Key changes:

  • Introduced _snapshot_last_change() helper to set GPKG last_change timestamps to Unix epoch (1970-01-01T00:00:00Z)
  • Added test to verify hash stability across writes at different times

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/geopins/drivers/gdf/filetypes/gpkg.py Added _snapshot_last_change() function and SQLite connection handling to normalize GeoPackage timestamps after writing
tests/geopins/drivers/gdf/filetypes/test_gpkg.py Added test verifying pin_hash stability when writing identical data at different times

@b-j-karl b-j-karl marked this pull request as ready for review November 10, 2025 03:38
@t-t-sonarqube
Copy link

t-t-sonarqube bot commented Nov 10, 2025

Passed Quality Gate passed

Issues

Measures

Project ID: tonkintaylor_geopins-python_93c10492-5d39-4c44-bcf3-bd14cb206319

View in SonarQube

@nathanjmcdougall nathanjmcdougall merged commit 9d241a3 into develop Nov 10, 2025
15 checks passed
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.

Attribute GPKG metadata causes inconsistent hash

3 participants