uranusjr commented on a change in pull request #18309:
URL: https://github.com/apache/airflow/pull/18309#discussion_r711567873
##########
File path: tests/utils/log/test_log_reader.py
##########
@@ -98,6 +99,26 @@ def prepare_db(self, session, create_task_instance):
)
ti.try_number = 3
self.ti = ti
+ dummy_ti = create_task_instance(
+ dag_id=self.DAG_ID,
+ task_id=self.DUMMY_TASK_ID,
+ start_date=self.DEFAULT_DATE,
+ run_type=DagRunType.SCHEDULED,
+ execution_date=self.DEFAULT_DATE,
+ state=TaskInstanceState.RUNNING,
+ )
+ dummy_ti.operator = 'DummyOperator'
+ self.dummy_ti = dummy_ti
+ external_task_marker_ti = create_task_instance(
+ dag_id=self.DAG_ID,
+ task_id=self.DUMMY_TASK_ID,
+ start_date=self.DEFAULT_DATE,
+ run_type=DagRunType.SCHEDULED,
+ execution_date=self.DEFAULT_DATE,
+ state=TaskInstanceState.RUNNING,
+ )
+ external_task_marker_ti.operator = 'ExternalTaskMarker'
+ self.external_task_marker_ti = external_task_marker_ti
Review comment:
Do we need to instantiate these task instances for all tests in this
class? They are only used by the four new tests and therefore should probably
be handled in a separate fixture (or two fixtures for each task type).
##########
File path: tests/utils/log/test_log_reader.py
##########
@@ -98,6 +99,26 @@ def prepare_db(self, session, create_task_instance):
)
ti.try_number = 3
self.ti = ti
+ dummy_ti = create_task_instance(
+ dag_id=self.DAG_ID,
+ task_id=self.DUMMY_TASK_ID,
+ start_date=self.DEFAULT_DATE,
+ run_type=DagRunType.SCHEDULED,
+ execution_date=self.DEFAULT_DATE,
+ state=TaskInstanceState.RUNNING,
+ )
+ dummy_ti.operator = 'DummyOperator'
+ self.dummy_ti = dummy_ti
+ external_task_marker_ti = create_task_instance(
+ dag_id=self.DAG_ID,
+ task_id=self.DUMMY_TASK_ID,
+ start_date=self.DEFAULT_DATE,
+ run_type=DagRunType.SCHEDULED,
+ execution_date=self.DEFAULT_DATE,
+ state=TaskInstanceState.RUNNING,
+ )
+ external_task_marker_ti.operator = 'ExternalTaskMarker'
+ self.external_task_marker_ti = external_task_marker_ti
Review comment:
Do we need to instantiate these task instances for all tests in this
class? They are only used by the four new tests and therefore should probably
be handled in a separate fixture (or two fixtures, one for each task type).
--
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]