bolkedebruin commented on code in PR #31565:
URL: https://github.com/apache/airflow/pull/31565#discussion_r1206454355
##########
airflow/serialization/serde.py:
##########
@@ -302,6 +308,11 @@ def _stringify(classname: str, version: int, value: T |
None) -> str:
return s
+def _is_pydantic(cls: Any) -> bool:
+ """Return True if the class is a pydantic model."""
+ return hasattr(cls, "validate") and hasattr(cls, "json") and hasattr(cls,
"dict")
Review Comment:
I'd prefer some distinguishing elements which is also more pythonic. Do you
really think that the combination of those fields is so common? If required, I
can also check for "__fields__" and "__fields_set__"
--
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]