Skip to content

Use with_child_unrestricted in pydantic_converter_v1 sample - #342

Open
PardhuTI wants to merge 1 commit into
temporalio:mainfrom
PardhuTI:use-with-child-unrestricted-pydantic-v1
Open

Use with_child_unrestricted in pydantic_converter_v1 sample#342
PardhuTI wants to merge 1 commit into
temporalio:mainfrom
PardhuTI:use-with-child-unrestricted-pydantic-v1

Conversation

@PardhuTI

@PardhuTI PardhuTI commented Aug 2, 2026

Copy link
Copy Markdown

What

pydantic_converter_v1/worker.py carried a TODO to switch its sandbox setup to
with_child_unrestricted once temporalio/sdk-python#254 was fixed and released.
That fix has shipped, so this replaces the manual "copy the children map and
delete the datetime key" workaround with the intended one-liner.

with_child_unrestricted("datetime") is equivalent here, and slightly more
complete: for a single-element path it clears the key from access, use, and
children, whereas the old code only removed it from children.

Closes #126

Testing

pytest tests/pydantic_converter_v1/ passes (workflow round-trips Pydantic
models with datetime fields); ruff format --check, ruff check, and
mypy are clean.

The upstream SDK fix this workaround waited on
(temporalio/sdk-python#254) has shipped, so replace the manual removal
of the datetime restriction with with_child_unrestricted.

Closes temporalio#126
@PardhuTI
PardhuTI requested a review from a team as a code owner August 2, 2026 14:13
@CLAassistant

CLAassistant commented Aug 2, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Update Pydantic converter example to reflect with_child_unrestricted changes

2 participants