File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 10
10
import sys
11
11
import traceback
12
12
import uuid
13
+ import warnings
13
14
from abc import ABC , abstractmethod
14
15
from dataclasses import dataclass
15
16
from datetime import datetime
@@ -477,6 +478,11 @@ def encoding(self) -> str:
477
478
478
479
def to_payload (self , value : Any ) -> Optional [temporalio .api .common .v1 .Payload ]:
479
480
"""See base class."""
481
+ # Check for pydantic then send warning
482
+ if hasattr (value , "parse_obj" ):
483
+ warnings .warn (
484
+ "If you're using pydantic model, refer to https://github.com/temporalio/samples-python/tree/main/pydantic_converter for better support"
485
+ )
480
486
# We let JSON conversion errors be thrown to caller
481
487
return temporalio .api .common .v1 .Payload (
482
488
metadata = {"encoding" : self ._encoding .encode ()},
You can’t perform that action at this time.
0 commit comments