Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The type of the following property is currently not supported: Multi Selection #68

Open
3 of 4 tasks
alikaz3mi opened this issue Jan 10, 2025 · 0 comments
Open
3 of 4 tasks
Labels
status:needs-triage Has not been triaged yet type:bug Something isn't working

Comments

@alikaz3mi
Copy link

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

In examples in https://st-pydantic.streamlit.app/, one example is Complex Default. When I ran the code in my own system I face the following issue:

The type of the following property is currently not supported: Multi Selection

What must I do?

Reproducible Code Example

from enum import Enum
from typing import Set

import streamlit as st
from pydantic import BaseModel, Field

import streamlit_pydantic as sp


class OtherData(BaseModel):
    text: str
    integer: int


class SelectionValue(str, Enum):
    FOO = "foo"
    BAR = "bar"


class ExampleModel(BaseModel):
    long_text: str = Field(
        ..., format="multi-line", description="Unlimited text property"
    )
    integer_in_range: int = Field(
        20,
        ge=10,
        le=30,
        multiple_of=2,
        description="Number property with a limited range.",
    )
    single_selection: SelectionValue = Field(
        ..., description="Only select a single item from a set."
    )
    multi_selection: Set[SelectionValue] = Field(
        ..., description="Allows multiple items from a set."
    )
    read_only_text: str = Field(
        "Lorem ipsum dolor sit amet",
        description="This is a ready only text.",
        readOnly=True,
    )
    single_object: OtherData = Field(
        ...,
        description="Another object embedded into this model.",
    )


data = sp.pydantic_form(key="my_form", model=ExampleModel)
if data:
    st.json(data.model_dump_json())

Steps To Reproduce

streamlit run the code

Expected Behavior

ability to select values to create a set

Current Behavior

The type of the following property is currently not supported: Multi Selection

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • streamlit-pydantic version:
    0.6.0

  • Python version:
    3.10.12

pydantic==2.10.5
pydantic-settings==2.7.1
pydantic_core==2.27.2
streamlit-pydantic==0.6.0

Additional Information

Thank you in advance

@alikaz3mi alikaz3mi added status:needs-triage Has not been triaged yet type:bug Something isn't working labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:needs-triage Has not been triaged yet type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant