sjyangkevin commented on code in PR #51059:
URL: https://github.com/apache/airflow/pull/51059#discussion_r2149922863


##########
airflow-core/src/airflow/serialization/serde.py:
##########
@@ -68,6 +68,28 @@
 _builtin_collections = (frozenset, list, set, tuple)  # dict is treated 
specially.
 
 
+def _is_namedtuple(cls: Any) -> bool:

Review Comment:
   Sure, will move this to the below and group them together with other private 
methods such as `_match` and `_convert`.



##########
airflow-core/src/airflow/serialization/serde.py:
##########
@@ -68,6 +68,28 @@
 _builtin_collections = (frozenset, list, set, tuple)  # dict is treated 
specially.
 
 
+def _is_namedtuple(cls: Any) -> bool:
+    """
+    Return True if the class is a namedtuple.
+
+    Checking is done by attributes as it is significantly faster than
+    using isinstance.
+    """
+    return hasattr(cls, "_asdict") and hasattr(cls, "_fields") and 
hasattr(cls, "_field_defaults")
+
+
+def _is_pydantic_model(cls: Any) -> bool:

Review Comment:
   Will move this to the below and group them together with other private 
methods such as `_match` and `_convert`.



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