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

Check expand_kwargs() input type before unmapping #25355

Merged

Conversation

uranusjr
Copy link
Member

This was originally done when the value is pushed in upstream, but that was removed when we implemented map(), and now should be done when the value is pulled. The task would have failed without these explicit checks, but with very cryptic error messages.

Close #25352

@uranusjr uranusjr requested review from kaxil, XD-DENG and ashb as code owners July 28, 2022 06:02
Comment on lines 253 to 254
if not isinstance(mappings, collections.abc.Sequence):
raise ValueError(f"expand_kwargs() expects a list[dict], not {type(mappings).__name__}")
Copy link
Member Author

Choose a reason for hiding this comment

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

This one shouldn’t be possible in theory since the upstream ensures the return value is list-like, but let’s check anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Yep. Does not cost us too much

uranusjr added 3 commits July 29, 2022 15:19
This was originally done when the value is pushed in upstream, but that
was removed when we implemented map(), and now should be done when the
value is pulled.
@uranusjr uranusjr force-pushed the aip-42-expand-kwargs-runtime-type-check branch from 8181127 to e35651b Compare July 29, 2022 07:19
@uranusjr uranusjr merged commit 4e786e3 into apache:main Jul 29, 2022
@uranusjr uranusjr deleted the aip-42-expand-kwargs-runtime-type-check branch July 29, 2022 08:58
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

expand_kwargs.map(func) gives unhelpful error message if func returns list
4 participants