pushpendu1991 commented on code in PR #64900:
URL: https://github.com/apache/airflow/pull/64900#discussion_r3287983712


##########
providers/google/src/airflow/providers/google/cloud/operators/dataflow.py:
##########
@@ -1176,3 +1178,145 @@ def execute(self, context: Context):
             raise AirflowException(self.response)
 
         return None
+
+
+class DataflowJobMetricsOperator(GoogleCloudBaseOperator):
+    """
+    Fetches metrics for a single Dataflow job and executes a callback function 
with the result.
+
+    .. seealso::
+        For more information on how to use this operator, take a look at the 
guide:
+        :ref:`howto/operator:DataflowJobMetricsOperator`
+
+    :param job_id: Dataflow job ID. Jinja-templated.
+    :param callback: Callback function that accepts the metrics list.
+        If provided, the function is called with the metrics and its result is 
returned.
+        If not provided, metrics are pushed to XCom and returned directly.
+        See: 
https://cloud.google.com/dataflow/docs/reference/rest/v1b3/MetricUpdate
+    :param fail_on_terminal_state: If set to True, raises an exception when 
the job
+        is in a terminal state. Default is False.

Review Comment:
   modified default to False



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