mohitgurav20 commented on code in PR #76859:
URL: https://github.com/apache/airflow/pull/76859#discussion_r4529865222


##########
airflow-core/src/airflow/serialization/serialized_objects.py:
##########
@@ -1966,6 +1975,39 @@ def get_dag_optional_fields_from_schema(cls) -> set[str]:
         optional_fields = operator_fields - required_fields
         return optional_fields
 
+    @classmethod
+    def _serialize_user_defined_macros(cls, dag_id: str, macros: dict) -> dict:
+        """
+        Return the JSON-safe entries from *macros*, dropping callables with a 
warning.
+
+        Only ``str``, ``int``, ``float``, ``bool``, ``None``, ``list``, and 
``dict``
+        values (recursively composed of the same types) survive serialization.
+        Any callable is skipped — the triggerer cannot reconstruct it from 
stored
+        JSON, so DAG authors who need callable macros in a trigger context 
must load
+        the bundle and re-import the DAG file instead.

Review Comment:
   Yeah sir will work on it 



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