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

use .get method with default {} for attributes["properties"] #35

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

Conversation

Gabbytam
Copy link

@Gabbytam Gabbytam commented Dec 29, 2023

Target was failing on below block for stripe charges where there is a field that was type = object but did not have a properties key.

if cleaned_type == "object":
            field_definitions[name] = build_struct_type(
                attributes["properties"], new_level
            )

Error log:

[info     ]     attributes["properties"], new_level cmd_type=elb consumer=True name=target-s3-parquet producer=False stdio=stderr string_id=target-s3-parquet
[info     ] KeyError: 'properties'

This change resolved the failure.

Ex of failing attribute:
image

Ex of other type object attribute:
image

@Gabbytam Gabbytam requested a review from a team as a code owner December 29, 2023 19:07
@ndrluis
Copy link
Member

ndrluis commented Jan 31, 2024

@Gabbytam, thank you for your contribution! Could you please add some tests for this fix?

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.

None yet

2 participants