Skip to content

Create shared sfeos helpers module #376

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

Merged
merged 34 commits into from
May 29, 2025
Merged

Create shared sfeos helpers module #376

merged 34 commits into from
May 29, 2025

Conversation

jonhealy1
Copy link
Collaborator

@jonhealy1 jonhealy1 commented May 14, 2025

Related Issue(s):

Description:

  • This pr moves shared elasticsearch/ opensearch logic out of core and into the sfeos_helpers module.
  • Other code duplicated in es/ os database_logic files has been moved into the sfeos_helpers module as well.
  • The readme has been updated/ reorganized and a table of contents has been added.

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable
  • Changes are added to the changelog

@jonhealy1 jonhealy1 marked this pull request as ready for review May 20, 2025 16:15
@jonhealy1
Copy link
Collaborator Author

jonhealy1 commented May 20, 2025

This will be a difficult pr to review maybe?

  1. The core module should be database-agnostic, so code that relied on es/ os was moved to the best of my ability. I moved the aggregations code to sfeos_helpers but maybe some should have stayed?
  2. Code that was shared between both backends was also moved to sfeos_helpers. More code could potentially be moved?
  3. The readme was refactored and I hope that all of the information was retained correctly and that the bullet point format improves readability.

@jonhealy1
Copy link
Collaborator Author

50 files changed so yes, difficult to review :)

@jamesfisher-geo
Copy link
Collaborator

This is a great change. Maintaining the duplicate code was getting cumbersome. I'll dig into this PR over the weekend 👍

@jonhealy1
Copy link
Collaborator Author

jonhealy1 commented May 23, 2025

Still a lot of duplicate code, but it's a start hopefully that will help improve maintenance and also keep the core module database agnostic.

@jonhealy1
Copy link
Collaborator Author

Sharing too much code could be troublesome in the future as well as the two projects diverge more from each other.

@TravisYeah
Copy link
Contributor

@jonhealy1 Nitpicking here but I feel like one of the main purposes of stac_fastapi/core is to deduplicate the shared logic. Why would we move this shared logic to another folder? Again, not a big deal but was curious on why.

@jonhealy1
Copy link
Collaborator Author

@TravisYeah stac-fastapi-core is meant to potentially support other backends besides for elasticsearch/ opensearch. For example, we built stac-fastapi-mongo with the core library.

Copy link
Collaborator

@jamesfisher-geo jamesfisher-geo left a comment

Choose a reason for hiding this comment

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

Overall looks great @jonhealy1 ! I think this structure makes the code much more maintainable.

I did not dig into the reviewing the functions and methods much since those stayed mostly the same AFAIK. I mostly checked to make sure the new structure and code imports looked okay.

I like your idea of releasing this as an alpha v5.0.0a0

@jonhealy1 jonhealy1 merged commit b215f1e into main May 29, 2025
15 checks passed
@jonhealy1 jonhealy1 deleted the sfeos-helpers branch May 29, 2025 04:31
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