-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Labels
status:needs-triageHas not been triaged yetHas not been triaged yettype:bugSomething isn't workingSomething isn't working
Description
Checklist
- I have searched the existing issues for similar issues.
- I added a very descriptive title to this issue.
- I have provided sufficient information below to help reproduce this issue.
Summary
Thanks for the great library, really powerful !
I have noticed a bug that you can reproduce with the minimalist example.
Reproducible Code Example
import streamlit as st
import streamlit_pydantic as sp
from pydantic import BaseModel
class Model(BaseModel):
i: int
s: str
a= Model(i=1, s="1")
b= Model(i=2, s="2")
init = st.selectbox(label="instance", options=[a, b])
data = sp.pydantic_form(key="f", model=init)
if data:
st.json(data)
Steps To Reproduce
When you change the init model from the select box, the string default is successfully updated but not the int.
Expected Behavior
No response
Current Behavior
No response
Is this a regression?
- Yes, this used to work in a previous version.
Debug info
- streamlit-pydantic version= { git = "https://github.com/lukasmasuch/streamlit-pydantic", branch = "main" }
- Python version: 3.12.5
Additional Information
Not sure how the session state this handled under the hood, do you have any quick work around ? Or if you have any idea where the bug can come from, please points me the function I can have a look.
Metadata
Metadata
Assignees
Labels
status:needs-triageHas not been triaged yetHas not been triaged yettype:bugSomething isn't workingSomething isn't working