Skip to content

Commit cdfd969

Browse files
committed
Delete redundant fix
1 parent 426a0e0 commit cdfd969

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

temporalio/contrib/pydantic.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
# pydantic v1
2626
from pydantic.json import pydantic_encoder as to_jsonable_python # type: ignore
2727

28-
import temporalio.workflow
2928
from temporalio.converter import (
3029
AdvancedJSONEncoder,
3130
CompositePayloadConverter,
@@ -34,7 +33,6 @@
3433
JSONPlainPayloadConverter,
3534
JSONTypeConverter,
3635
)
37-
from temporalio.worker.workflow_sandbox._restrictions import RestrictionContext
3836

3937
# Note that in addition to the implementation in this module, _RestrictedProxy
4038
# implements __get_pydantic_core_schema__ so that pydantic unwraps proxied types
@@ -53,15 +51,6 @@ def to_typed_value(self, hint: Type, value: Any) -> Any:
5351
raise TypeError(
5452
f"Cannot convert to {model}, value is {type(value)} not dict"
5553
)
56-
if temporalio.workflow.unsafe.in_sandbox():
57-
# Unwrap proxied model field types so that Pydantic can call their constructors
58-
model = pydantic.create_model(
59-
model.__name__,
60-
**{ # type: ignore
61-
name: (RestrictionContext.unwrap_if_proxied(f.annotation), f)
62-
for name, f in model.model_fields.items()
63-
},
64-
)
6554
if hasattr(model, "model_validate"):
6655
return model.model_validate(value)
6756
elif hasattr(model, "parse_obj"):

0 commit comments

Comments
 (0)