You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have not tested or created a sample for v2. There is a separate issue at #97 for that. But I think the issue to resolve this unrelated TODO for v1 is unrelated to your issue.
(also transferring this issue to the samples repo since it doesn't belong in primary repo)
Update: the SDK now contains official Pydantic v2 support, which supports datetime and many other field types, and the sample has been updated. This is the sample to follow for Pydantic v2: https://github.com/temporalio/samples-python/tree/main/pydantic_converter. The old pydantic v1 sample is still in the repo, but if at all possible please use pydantic v2 with the official SDK support.
Activity
cretz commentedon Jun 18, 2024
Thanks! Agreed we can now perform that TODO.
baegmon commentedon Jul 7, 2024
Any update on this one? Currently I'm using Pydantic v2 models with:
from pydantic_core import to_jsonable_python
and
Would love to see an example without seeing warnings from https://github.com/temporalio/sdk-python/blob/main/temporalio/converter.py#L561
cretz commentedon Jul 8, 2024
That warning is unrelated to this issue. This issue is simply changing how the sandbox is created. That warning is because presumably you are not using a custom converter like https://github.com/temporalio/samples-python/blob/main/pydantic_converter/converter.py and configuring it on the client.
baegmon commentedon Jul 9, 2024
I've tried that example actually, with just one difference which is using
from pydantic_core import to_jsonable_python
overpydantic_encoder
for v2 on the converter: https://github.com/temporalio/samples-python/blob/main/pydantic_converter/converter.py#L32I am still getting the issue on
temporalio==1.6.0
, do you not get this error?This is just on a default python 3.12 devcontainer.
cretz commentedon Jul 9, 2024
We have not tested or created a sample for v2. There is a separate issue at #97 for that. But I think the issue to resolve this unrelated TODO for v1 is unrelated to your issue.
(also transferring this issue to the samples repo since it doesn't belong in primary repo)
dandavison commentedon Apr 9, 2025
Update: the SDK now contains official Pydantic v2 support, which supports datetime and many other field types, and the sample has been updated. This is the sample to follow for Pydantic v2: https://github.com/temporalio/samples-python/tree/main/pydantic_converter. The old pydantic v1 sample is still in the repo, but if at all possible please use pydantic v2 with the official SDK support.