michalslowikowski00 commented on a change in pull request #10343:
URL: https://github.com/apache/airflow/pull/10343#discussion_r471309592
##########
File path: tests/providers/google/cloud/operators/test_dataproc.py
##########
@@ -453,6 +477,50 @@ def test_execute(self, mock_hook):
job_id=job_id, project_id=GCP_PROJECT, location=GCP_LOCATION
)
+ @provide_session
+ def test_operator_extra_links(self, session):
+ job = {}
+ job_id = 'test_job_id_12345'
+ execution_date = datetime(2020, 7, 20)
+
+ op = DataprocSubmitJobOperator(
+ task_id=TASK_ID,
+ location=GCP_LOCATION,
+ project_id=GCP_PROJECT,
+ job=job,
+ gcp_conn_id=GCP_CONN_ID,
+ cluster_name=CLUSTER_NAME
+ )
+ self.dag.clear()
+ session.query(XCom).deete()
+
+ ti = TaskInstance(
+ task=op,
+ execution_date=execution_date
+ )
+
+ self.assertEqual(
Review comment:
Little bit over engineering but maybe this way:
Them `# pylint: disable=line-too-long` won't be needed anymore.
```
URL = "https://console.cloud.google.com/dataproc/"
cluster_name = CLUSTER_NAME
region = GCP_LOCATION
project_id = GCP_PROJECT
self.assertEqual(
f'{URL}clusters/{cluster_name}/job?region={region}&project={project_id}'
op.get_extra_links(execution_date, DataprocJobLink.name)
)
```
----------------------------------------------------------------
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:
[email protected]