Repository navigation
Support a KwargsInput as a source of a MultiSourceInput - #49
Merged
Merged
Conversation
A section fed its input specs only to the input of its `kwargs` parameter, so a kwargs input configured as one of the sources of a multi-source input got no nested `inputs`: its nested inputs had no `bound_data_factory` and no element for their types, and the app failed as soon as that source rendered. ExecContainerBase now also feeds the section's input specs (minus the multi-source input's own spec and the `kwargs` one) to every kwargs-input source of a multi-source input, with the source's own nested inputs winning. Closes #45 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #45
What
A section fed its input specs only to the input of its
kwargsparameter (_feed_kwargs_input_spec). AKwargsInputconfigured as one of the sources of aMultiSourceInputtherefore gotinputs=None: its nested inputs had nobound_data_factoryand no element for their types, so the app failed as soon as that source was rendered ('NoneType' object is not iterable, orNo factory provided to build a BoundData/keywords must be stringsdepending on what was configured by hand).ExecContainerBasenow also feeds the section's input specs to every kwargs-input source of a multi-source input (_feed_multi_source_kwargs_input_specs), leaving out the multi-source input's own spec (so a nested parameter of the same name does not nest it again) and thekwargsone. The source's own nestedinputswin over the section's. The merge logic is shared with thekwargscase through_with_section_inputs; nothing is mutated (the #39 isolation still holds).Tests
tests/test_kwargs_input_in_multi_source.py: renders the kwargs source through a minimal concrete section; checks values, nested element types, nested keys scoped to the multi-source input (Input keys inside a KwargsInput are derived from get_kwargs, so they collide across functions #40), and that the source's own nested inputs win. All three fail without the fix.AppTestapp using streamlitfront'sMultiSourceInput+KwargsInput: selecting the kwargs source renders its widgets and submitting returns{'a': 5, 'b': 'hi'}.🤖 Generated with Claude Code
https://claude.ai/code/session_01WbXPoGdRqSs54sWhBnyaFS