Skip to content

Deprecated pydantic config #117

Open

Description

@jekozyra

smart_union and allow_population_by_field_name which are used in UniversalBaseModel are both deprecated per pydantic.

Activity

  1. TheJedinator commented on Sep 8, 2025

    @TheJedinator

    Since per your contribution guidelines you suggest opening a discussion and @jekozyra has done so I'll leave the very minimal change required for you to stop having warnings pushed to all pydantic v2 customers.

    class UniversalBaseModel(pydantic.BaseModel):
        class Config:
            # note smart_union has been removed here as it's now the default in pydantic v2
            populate_by_name = True
            validate_by_name = True # formerly allow_population_by_field_name
            json_encoders = {dt.datetime: serialize_datetime}
            # Allow fields beginning with `model_` to be used in the model
            protected_namespaces = ()
    
  2. TheJedinator commented on Sep 8, 2025

    @TheJedinator

    More info about pydantic unions can be found here: https://docs.pydantic.dev/latest/concepts/unions/

  3. aprams commented on Nov 27, 2025

    @aprams

    We would also appreciate this! Polluting our logs currently

  4. cmdelatorre commented on Dec 9, 2025

    @cmdelatorre

    Same here. We'd greatly appreciate it if this could be updated.

  5. sidmitra commented on Apr 21, 2026

    @sidmitra

    Note that pydantic.v1 stuff might be holding up other upgrades. I believe pydantic.v1 isn't officially supported on python 3.14+

    pydantic/pydantic#12618

    When a module is imported from pydantic.v1 and a user is running Python 3.14, they'll get a warning: "Core Pydantic V1 functionality isn't compatible with Python 3.14 or greater."

    It might be ok to pin to pydantic v2 or do conditional import based logic to do different things if pydantic v2 or v1 was found(for backward compatability). Otherwise mostly it means we'd have to pin to a temporary git fork till this is resolved here.

    PS: I can send a PR if needed.

  6. darmen-engineering commented on May 7, 2026

    @darmen-engineering

    We would also appreciate this! Polluting our logs currently

    Same here! @aprams Polluting our logs too.

  7. darmen-engineering commented on May 18, 2026

    @darmen-engineering

    PS: I can send a PR if needed.

    @sidmitra have you sent one? Looking forward to it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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