Spaces:
Running on Zero
Running on Zero
Handle legacy 'Unknown' sex values gracefully
Browse files- Silently convert 'Unknown' to empty string in validation
- Handle 'Unknown' in update_settings_column function
- Prevents 'Unknown is not in choices' error from Gradio
- Update uv.lock for Python version constraint
- Users will need to manually select Male/Female for analysis
Files changed (3)
432 unmodified lines433434435436437438439440441432 unmodified lines # Convert None to empty string for display (especially for Sex column) if new_value is None: new_value = "" # Convert legacy "Unknown" sex values to empty string if column_name == "Sex" and new_value == "Unknown": new_value = "" updated_df[column_name] = new_value return updated_df
182 unmodified lines183184185186187188189187190191192193182 unmodified lines settings_df.at[idx, "Site Type"] = "Primary" # Only warn about invalid sex values that are not empty/None # Empty/None will be validated at analysis time # Convert old "Unknown" values to empty string silently sex_value = row["Sex"] if sex_value == "Unknown": settings_df.at[idx, "Sex"] = "" if sex_value and sex_value not in SEX_OPTIONS: elif sex_value and sex_value not in SEX_OPTIONS: warnings.append( f"Slide {slide_name}: Invalid sex value '{sex_value}'. Valid options are: {', '.join(SEX_OPTIONS)}. " )src/mosaic/ui/app.py+3
src/mosaic/ui/utils.py+4-1
uv.lock