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: change condition in remove_thumbnail_asset to resolve key error #293

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

Conversation

botanical
Copy link
Member

Summary: Summary of changes
Addresses VEDA-287: Resolve Key error in veda_dataset_pipeline

Changes

  • Updates condition to check if assets is not None before calling payload.pop("assets")

PR Checklist

  • Update CHANGELOG
  • Unit tests
  • Ad-hoc testing - Deploy changes and test manually
  • Integration tests

@botanical botanical changed the title fix: change condition in remove_thumnail_asset to resolve key error fix: change condition in remove_thumbnail_asset to resolve key error Jan 29, 2025
@@ -25,7 +25,7 @@ def remove_thumbnail_asset(ti):
if assets.get("thumbnail"):
assets.pop("thumbnail")
# if thumbnail was only asset, delete assets
if not assets:
if not assets and (assets is not None):
Copy link
Contributor

@anayeaye anayeaye Jan 29, 2025

Choose a reason for hiding this comment

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

We need to update line 24 too, so that we can test if assets exists

assets = payload.get("assets", {}) should be assets = payload.get("assets", None)

EDIT
I think having an assets key at all is a problem for the existing pipeline because the pipeline and stac schemas have conflicting assets meanings--so this level of logic about other non-thumbnail assets seems unhelpful. @ividito @botanical should we just check if assets is in payload.keys() and then if it is payload.pop("assets")?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that the current logic is awkward. I also think we should just pop the assets from the payload.

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