shahar1 commented on code in PR #64900:
URL: https://github.com/apache/airflow/pull/64900#discussion_r3118177782
##########
providers/google/src/airflow/providers/google/cloud/operators/dataflow.py:
##########
@@ -1176,3 +1181,286 @@ def execute(self, context: Context):
raise AirflowException(self.response)
return None
+
+class DataflowGetMetricsOperator(GoogleCloudBaseOperator):
+ """
+ Fetches metrics for a Dataflow job and routes the result to one or more
+ destinations based on what the caller provides.
Review Comment:
You're correct - it shouldn't have a destination at all, just return it to
an Xcom.
In your Dag you should use an operator that infests the data from the Xcom,
and then you could do whatever you want (inser to bq or pubsub).
Of course, you may create your own custom operator that does all actions in
a single move (you may even inherit it from the new operator you plan to
contribute), but for making it to the open source it's improtant that it will
have only one responsibility.
##########
providers/google/src/airflow/providers/google/cloud/operators/dataflow.py:
##########
@@ -1176,3 +1181,286 @@ def execute(self, context: Context):
raise AirflowException(self.response)
return None
+
+class DataflowGetMetricsOperator(GoogleCloudBaseOperator):
+ """
+ Fetches metrics for a Dataflow job and routes the result to one or more
+ destinations based on what the caller provides.
Review Comment:
You're correct - it shouldn't have a destination at all, just return it to
an Xcom.
In your Dag you should use an operator that ingests the data from the Xcom,
and then you could do whatever you want (inser to bq or pubsub).
Of course, you may create your own custom operator that does all actions in
a single move (you may even inherit it from the new operator you plan to
contribute), but for making it to the open source it's improtant that it will
have only one responsibility.
--
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]