Skip to content

Scope the nested input keys of a kwargs input to that input - #46

Merged
thorwhalen merged 1 commit into
masterfrom
fix/40-kwargs-input-keys
Oct 20, 2026
Merged

thorwhalen merged 1 commit into
masterfrom
fix/40-kwargs-input-keys

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Fixes #40.

KwargsInputBase.pre_render built its nested function as get_kwargs, and mk_input_element_specs derives input keys as <func name>_<param>, so every parameter inside any KwargsInput was keyed get_kwargs_<param>: two functions whose kwargs input each have a data parameter shared value, widget key and uploader state. The nested function is now named after the kwargs input's own input_key (e.g. foo_kwargs), giving foo_kwargs_data.

Regression test: tests/test_kwargs_input_keys.py (fails on master with get_kwargs_data). streamlitfront tests pass against this branch.

The other finding in the issue (a KwargsInput inside a MultiSourceInput fails at app build) is a separate problem, filed as #45.

🤖 Generated with Claude Code

KwargsInputBase.pre_render named its get_kwargs function "get_kwargs", and
mk_input_element_specs derives input keys from the function name, so every
parameter inside any KwargsInput got the key get_kwargs_<param> and collided
across functions. Name the function after the kwargs input's input_key.

Fixes #40 (the MultiSourceInput shape it mentions is split out to #45)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thorwhalen
thorwhalen merged commit b246a05 into master Oct 20, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the fix/40-kwargs-input-keys branch October 20, 2026 14:01
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.

Input keys inside a KwargsInput are derived from get_kwargs, so they collide across functions

1 participant