bolkedebruin commented on code in PR #56758:
URL: https://github.com/apache/airflow/pull/56758#discussion_r2480371522


##########
airflow-core/src/airflow/serialization/typing.py:
##########
@@ -29,4 +29,11 @@ def is_pydantic_model(cls: Any) -> bool:
     """
     # __pydantic_fields__ is always present on Pydantic V2 models and is a 
dict[str, FieldInfo]
     # __pydantic_validator__ is an internal validator object, always set after 
model build
-    return hasattr(cls, "__pydantic_fields__") and hasattr(cls, 
"__pydantic_validator__")
+    # Check if it is not a dataclass to prevent detecting pydantic dataclasses 
as pydantic models
+    from dataclasses import is_dataclass

Review Comment:
   I agree with @uranusjr , let's keep it at the top. 



-- 
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