Skip to content

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

@alikaz3mi

Description

@alikaz3mi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions