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

make use of BulkTransactionsClient easily overridable #559

Closed
wants to merge 1 commit into from

Conversation

keul
Copy link
Contributor

@keul keul commented Apr 5, 2023

TransactionsClient now exposes a bulk_client_cls, easily customizable in subclasses.

Description:

Currently is quite easy to extend the stac_fastapi.sqlalchemy packageto be connects 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.

bulk_client = BulkTransactionsClient(session=self.session)

This force me to define the create_item in my subclass.

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

PR Checklist:

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

TransactionsClient now exposes a bulk_client_cls, easily editable in subclasses
@gadomski gadomski self-requested a review April 5, 2023 14:28
@gadomski gadomski removed their request for review May 8, 2023 13:03
@gadomski
Copy link
Member

gadomski commented May 9, 2023

Thanks for the contribution, but with #555 merged, please re-open this PR on https://github.com/stac-utils/stac-fastapi-sqlalchemy/. For more background on the backend breakout process, see #517.

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.

2 participants