Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pydantic throws an error when import types #102

@eavanvalkenburg

Description

@eavanvalkenburg

Description of the bug:

When using classes from types in other classes which use pydantic, pydantic throws this error:
pydantic.errors.PydanticUserError: Please use typing_extensions.TypedDictinstead oftyping.TypedDict on Python < 3.12.

Actual vs expected behavior:

No error

Any other information you'd like to share?

Should be an easy fix to add:

import sys
if sys.version_info >= (3, 12):
    from typing import TypedDict
else:
    from typing_extensions import TypedDict

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:python sdkIssue/PR related to Python SDKstatus:awaiting user responseAwaiting a response from the authorstatus:staleIssue/PR will be closed automatically if there's no further activitytype:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions