skrawcz commented on code in PR #1042:
URL: https://github.com/apache/burr/pull/1042#discussion_r4660340084


##########
burr/integrations/serde/pydantic.py:
##########
@@ -58,8 +58,12 @@ def _is_module_allowed(module_name: str, allowlist: 
Optional[List[str]]) -> bool
 
 @serde.serialize.register(pydantic.BaseModel)
 def serialize_pydantic(value: pydantic.BaseModel, **kwargs) -> dict:
-    """Uses pydantic to dump the model to a dictionary and then adds the 
__pydantic_class to the dictionary."""
-    _dict = value.model_dump()
+    """Uses pydantic to dump the model to a dictionary and then adds the 
__pydantic_class to the dictionary.
+
+    The model is dumped in JSON mode, so fields such as datetimes, UUIDs and 
Decimals come out as
+    JSON-compatible values that persisters can store and that pydantic 
validates back on load.
+    """
+    _dict = value.model_dump(mode="json")

Review Comment:
   let's think through how this can also be opt-in so that we can roll this out 
in a backwards compatible way.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to