Skip to content

Compatibility with Pydantic 2.10 #369

@Viicos

Description

@Viicos

Due to a circular import, the AnyComponent alias is imported in an if TYPE_CHECKING: block in fastui.components.forms:

if _t.TYPE_CHECKING:
from . import AnyComponent

and later used in one of the defined models for this module:

loading: '_t.Union[_t.List[AnyComponent], None]' = None
"""Components to display while the form is submitting."""
footer: '_t.Union[_t.List[AnyComponent], None]' = None
"""Components to display in the form footer."""

While this used to work in <2.10 because of namespace pollution inconsistencies, it doesn't with 2.10 as AnyComponent (which doesn't exist in the module namespace at runtime) isn't available.

Best way forward would be to fix the circular import, haven't found a viable implementation yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions