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

Submit STAC using transactions API #297

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Conversation

ividito
Copy link
Contributor

@ividito ividito commented Feb 13, 2025

Proposed implementation for #288

Original ingest API support is maintained through an Airflow variable. I learned while setting this up that this is not a recommended approach, but it is consistent with what we do elsewhere.

@ividito ividito force-pushed the feat/transactions-api branch from ad3fac7 to cccda9e Compare February 13, 2025 17:15
Copy link
Contributor

@amarouane-ABDELHAK amarouane-ABDELHAK left a comment

Choose a reason for hiding this comment

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

Thank you for the PR. I just left some small comments

class TransactionsApi:

@classmethod
def from_veda_auth_secret(cls, *, secret_id: str, base_url: str) -> "IngestionApi":
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the return type hint be "TransactionsApi" instead of "IngestionApi"

response.raise_for_status()
except Exception as ex:
print(response.text)
raise f"Error, {ex}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Raise should be derived from a baseException otherwise it won't raise a string 🤔
Probably we should use

raise RuntimeError(f"Error, {ex}")

:param token: Optional Bearer token for authenticated STAC APIs.
"""
self.stac_ingestor_api_url = stac_ingestor_api_url.rstrip('/')
self.cognito_app_secret = cognito_app_secret
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are we using self.cognito_app_secret?

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