Skip to content

Commit

Permalink
fix anonymize index from bug None to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
dayesouza committed Nov 11, 2024
1 parent 3d01a2b commit 5f15420
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions app/workflows/anonymize_case_data/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,35 +500,44 @@ def create(sv: ds_variables.SessionVariables, workflow: None):
st.markdown("##### Configure flow (alluvial) chart")
attribute_type_options = [""] + list(sdf.columns.to_numpy())
highlight_options = ["", *options]
source_attribute_index = (
attribute_type_options.index(
chart_individual_configuration["source_attribute"]
)
if chart_individual_configuration["source_attribute"]
in attribute_type_options
else 0
)
source_attribute = st.selectbox(
"Source/origin attribute type",
options=attribute_type_options,
index=attribute_type_options.index(
chart_individual_configuration["source_attribute"]
if chart_individual_configuration["source_attribute"]
in attribute_type_options
else None,
),
index=source_attribute_index,
)
target_attribute_index = (
attribute_type_options.index(
chart_individual_configuration["target_attribute"]
)
if chart_individual_configuration["target_attribute"]
in attribute_type_options
else 0
)
target_attribute = st.selectbox(
"Target/destination attribute type",
options=attribute_type_options,
index=attribute_type_options.index(
chart_individual_configuration["target_attribute"]
if chart_individual_configuration["target_attribute"]
in attribute_type_options
else None,
),
index=target_attribute_index,
)
highlight_attribute_index = (
attribute_type_options.index(
chart_individual_configuration["highlight_attribute"]
)
if chart_individual_configuration["highlight_attribute"]
in attribute_type_options
else 0
)
highlight_attribute = st.selectbox(
"Highlight attribute",
options=highlight_options,
index=highlight_options.index(
chart_individual_configuration["highlight_attribute"]
if chart_individual_configuration["highlight_attribute"]
in highlight_options
else None,
),
index=highlight_attribute_index,
)

if (
Expand Down

0 comments on commit 5f15420

Please sign in to comment.