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

GTC-2898 Modify resolution metadata fields #585

Merged
merged 3 commits into from
Sep 18, 2024

Conversation

manukala6
Copy link
Member

@manukala6 manukala6 commented Sep 7, 2024

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side). Don't request your master!
  • Make sure you are making a pull request against the develop branch (left side). Also you should start your branch off our develop.
  • Check the commit's or even all commits' message styles matches our requested structure.
  • Check your code additions will fail neither code linting checks nor unit test.

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: GTC-2898

Currently one metadata field for resolution, resolution, representing spatial resolution in square meters.

What is the new behavior?

  • spatial_resolution metadata field (int, STAC-compliant) for spatial resolution in square meters
  • resolution_description metadata field (string) for front-end display purposes, such as 10 hectares, 10 degrees, etc.)

Does this introduce a breaking change?

  • Yes
  • No

Other information

@manukala6 manukala6 marked this pull request as ready for review September 9, 2024 13:11
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.18%. Comparing base (17112fe) to head (ba03419).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #585      +/-   ##
===========================================
+ Coverage    81.12%   81.18%   +0.06%     
===========================================
  Files          128      129       +1     
  Lines         5821     5841      +20     
===========================================
+ Hits          4722     4742      +20     
  Misses        1099     1099              
Flag Coverage Δ
unittests 81.18% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Collaborator

@danscales danscales left a comment

Choose a reason for hiding this comment

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

Looks good (except for my one comment), though I don't know the full details on how alembic migrations are supposed to look.

response.json()["data"]["metadata"]["resolution"]
== version_metadata["resolution"]
response.json()["data"]["metadata"]["spatial_resolution"]
== version_metadata["spatial_resolution"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since you fix this case in the deprecated test, maybe also fix the case at line 212 (change resolution to "spatial_resolution", and also probably "title" to "spatial_resolution".

Copy link
Member

@solomon-negusse solomon-negusse left a comment

Choose a reason for hiding this comment

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

Code looks ok but have a question on migration: since you're dropping the resolution column, do you have a script that'd migrate the existing resolution data to the new column?

@danscales pointed out alter_column that I missed in first review

Copy link
Member

@dmannarino dmannarino left a comment

Choose a reason for hiding this comment

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

Nice!

@danscales
Copy link
Collaborator

Code looks ok but have a question on migration: since you're dropping the resolution column, do you have a script that'd migrate the existing resolution data to the new column?

I was assuming that his use of op.alter_column(..., 'resolution', 'spatial_resolution', ...) moves the data over from the old column to the new column name, but good to confirm. (And I'm assuming the data would be lost if he instead used op.drop_column() and op.add_column())

@manukala6 manukala6 merged commit 96e7797 into develop Sep 18, 2024
2 checks passed
@manukala6 manukala6 deleted the feature/metadata_field_update branch September 18, 2024 16:56
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.

5 participants