amoghrajesh commented on code in PR #57853:
URL: https://github.com/apache/airflow/pull/57853#discussion_r2533401357


##########
airflow-core/src/airflow/serialization/serialized_objects.py:
##########
@@ -1862,10 +1878,39 @@ def _is_excluded(cls, var: Any, attrname: str, op: 
DAGNode):
         # Check if value matches client_defaults (hierarchical defaults 
optimization)
         if cls._matches_client_defaults(var, attrname):
             return True
-        schema_defaults = cls.get_schema_defaults("operator")
 
+        # for const fields, we should always be excluded when False, 
regardless of client_defaults
+        # Use class-level cache for optimisation
+        if not hasattr(cls, "_const_fields"):
+            cls._const_fields = cls.get_operator_const_fields()

Review Comment:
   Thought I removed it. No we dont need it anymore.
   
   get_operator_const_fields() is only called from one place and its called 
once per class when initializing cls._const_fields, the class-level cache 
(cls._const_fields) persists for the class lifetime.



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