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

Fix collection extent #79

Merged
merged 1 commit into from
Aug 16, 2023
Merged

Conversation

anayeaye
Copy link
Contributor

What

Use inbuilt pgstac utility function pgstac.collection_extent(collection_id text) to apply the maximum date range from the items partitions instead of the outdated collection_temporal_extent utility that uses only the nominal item datetime.

How tested

I executed and verified this method in a test database deployed for this backend pr. I'm still trying to think of ways to test the actual changes in the ingestor but the updating dev deployment and running an actual ingest may be the easiest way to go.

UPDATE collections set content = content || pgstac.collection_extent(collections.id)
WHERE collections.id = :_collection;

NASA-IMPACT/veda-backend#211

@anayeaye anayeaye requested review from slesaad and ividito August 14, 2023 21:07
@ividito
Copy link
Collaborator

ividito commented Aug 15, 2023

Would the same thing be accomplished by toggling the update_collection_extent setting in pgstac? This is currently set to false in our dev environment. The code looks similar, but I'm not certain what the practical difference is.

@anayeaye
Copy link
Contributor Author

accomplished by toggling the update_collection_extent setting in pgstac

@ividito yes! that's the ultimate plan but we will need to set up pg_cron to schedule the event. That's next in line after testing and pushing the changes to GHGC. For now this is a quick fix we want to test in an easier VEDA environment before GHGC which is heading to production very soon.

Copy link
Member

@slesaad slesaad left a comment

Choose a reason for hiding this comment

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

LGTM

@anayeaye anayeaye merged commit dd7c315 into dev Aug 16, 2023
@anayeaye anayeaye deleted the fix/collection-summaries-and-extents branch August 16, 2023 19:29
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