Skip to content

Commit aae176e

Browse files
committed
Delete previous pydantic object sniffing hack
1 parent 6573171 commit aae176e

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

temporalio/converter.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,18 +1523,6 @@ def value_to_type(
15231523
# TODO(cretz): Want way to convert snake case to camel case?
15241524
return hint(**field_values)
15251525

1526-
# If there is a @staticmethod or @classmethod parse_obj, we will use it.
1527-
# This covers Pydantic models.
1528-
parse_obj_attr = inspect.getattr_static(hint, "parse_obj", None)
1529-
if isinstance(parse_obj_attr, classmethod) or isinstance(
1530-
parse_obj_attr, staticmethod
1531-
):
1532-
if not isinstance(value, dict):
1533-
raise TypeError(
1534-
f"Cannot convert to {hint}, value is {type(value)} not dict"
1535-
)
1536-
return getattr(hint, "parse_obj")(value)
1537-
15381526
# IntEnum
15391527
if inspect.isclass(hint) and issubclass(hint, IntEnum):
15401528
if not isinstance(value, int):

0 commit comments

Comments
 (0)