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

Made use of BulkTransactionsClient easily overridable #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

keul
Copy link
Contributor

@keul keul commented May 11, 2023

Description:

Migrated from stac-utils/stac-fastapi#559

Currently is quite easy to extend the stac_fastapi.sqlalchemy package to be connectes to custom database structure.
This can be done by OOP inheritance and is working well.

One of the customisation I did in my project is the use of custom TransactionsClient and BulkTransactionsClient. 90% of the original code is OK, I just need to change some class-levels attributes (new ORM models, etc).

Then I found that TransactionsClient is internally using an hardcoded reference to BulkTransactionsClient.

https://github.com/stac-utils/stac-fastapi-sqlalchemy/blob/main/stac_fastapi/sqlalchemy/transactions.py#L49

This force me to re-define the create_item in my subclass to just change one line.

The PR is just making this reference easier to be overridden.

PR Checklist:

  • pre-commit hooks pass locally
  • Tests pass (run make test) some tests are failing, but also in the current master
  • Documentation has been updated to reflect changes, if applicable, and docs build successfully (run make docs)
  • Changes are added to the CHANGELOG.

@keul keul force-pushed the prevent-bulkclient-shadow-usage branch from abc1a09 to ef48ab3 Compare May 11, 2023 11:50
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.

1 participant