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(python-cdk): Ensure at least one element returned by decoder #43043

Merged
merged 3 commits into from
Aug 5, 2024

Conversation

maxi297
Copy link
Contributor

@maxi297 maxi297 commented Aug 3, 2024

What

Another proposition for #43018

This P1 shows a bug where if the response is an empty list, this line will break with a stop iteration. The interface is not meant to raise a StopIteration error and the user should always expect to have at least one answer. This is my hypothesis based on this case hence, we will perform the same behavior on empty lists.

How

If the response is an empty list, return a generator that will have only one empty dictionary

User Impact

This should fix the P1 issue.

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

Copy link

vercel bot commented Aug 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Aug 5, 2024 0:25am

@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Aug 3, 2024
@maxi297 maxi297 requested review from artem1205 and strosek August 3, 2024 01:45
Copy link
Contributor

@artem1205 artem1205 left a comment

Choose a reason for hiding this comment

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

LGTM!
This solution is preferable since there are other places where decoder is used.

Copy link
Contributor

@strosek strosek left a comment

Choose a reason for hiding this comment

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

This also looks good to me. Thanks!

@maxi297
Copy link
Contributor Author

maxi297 commented Aug 5, 2024

CATs for shopify are failing but the error is the same as the ones on master in the previous days and should be fixed with #42973.

The Connector Regression Tests failing is not a check which I usually rely on so I'm ready to bypass it as well since the error doesn't seem like a connector error but a CI error.

Hence, we will merge this change even with the red in the CI.

@maxi297
Copy link
Contributor Author

maxi297 commented Aug 5, 2024

/approve-regression-tests

Check job output.

✅ Approving regression tests

@maxi297 maxi297 merged commit f8dfb52 into master Aug 5, 2024
30 of 33 checks passed
@maxi297 maxi297 deleted the maxi297/fix-json-decode-stop-iteration branch August 5, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDK Connector Development Kit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants