You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/01/10 00:30:35 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #7119: [AIRFLOW-5840] Add operator extra link to external task sensor

kaxil commented on a change in pull request #7119: [AIRFLOW-5840] Add operator extra link to external task sensor
URL: https://github.com/apache/airflow/pull/7119#discussion_r365025063
 
 

 ##########
 File path: airflow/sensors/external_task_sensor.py
 ##########
 @@ -21,14 +21,31 @@
 
 from sqlalchemy import func
 
+from airflow.configuration import conf
 from airflow.exceptions import AirflowException
-from airflow.models import DagBag, DagModel, DagRun, TaskInstance
+from airflow.models import BaseOperatorLink, DagBag, DagModel, DagRun, TaskInstance
 from airflow.sensors.base_sensor_operator import BaseSensorOperator
 from airflow.utils.decorators import apply_defaults
 from airflow.utils.session import provide_session
 from airflow.utils.state import State
 
 
+class ExternalTaskLink(BaseOperatorLink):
+    name = 'External DAG'
+
+    def get_link(self, operator, dttm):
+        if isinstance(operator, ExternalTaskSensor):
+            possible_execution_dates = operator.get_possible_target_execution_dates(execution_date=dttm)
 
 Review comment:
   This won't work because of the use of this function.
   
   Check the Qubole Operator and how the test is implemented for it:
   
   https://github.com/apache/airflow/blob/803a87f2b2b564b3e8784de305f5bb4e9578e578/tests/contrib/operators/test_qubole_operator.py#L146-L176

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services