From 965af17c516f3e1f41fb7a402133cee582995edd Mon Sep 17 00:00:00 2001 From: Ovler Date: Sat, 30 Nov 2024 03:47:26 -0500 Subject: [PATCH] feat: add custom value input for target selection in data transformation --- src/ia_collection_analyzer/streamlit.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ia_collection_analyzer/streamlit.py b/src/ia_collection_analyzer/streamlit.py index 3d06d162..cd1314fc 100644 --- a/src/ia_collection_analyzer/streamlit.py +++ b/src/ia_collection_analyzer/streamlit.py @@ -268,10 +268,18 @@ def transform_data(): available_targets = [ v for v in formatted_values if v not in st.session_state.used_values ] + available_targets.append("Custom value...") + target_value = st.selectbox( - "Target Value:", available_targets, key="target_value", on_change=None + "Target Value:", available_targets, key="target_value" ) + if target_value == "Custom value...": + custom_target = st.text_input( + "Enter custom value:", key="custom_target" + ) + target_value = f"{custom_target} (custom)" + with col3: if st.button("Add", key="add_mapping"): if target_value and selected_sources: