SEPURI-SAI-KRISHNA commented on code in PR #74358:
URL: https://github.com/apache/airflow/pull/74358#discussion_r4506531109
##########
providers/google/tests/unit/google/cloud/transfers/test_gcs_to_bigquery.py:
##########
@@ -2200,6 +2200,32 @@ def
test_execute_without_external_table_async_should_execute_successfully(
trigger_cls =
session.scalar(select(Trigger.classpath).where(Trigger.id == ti.trigger_id))
assert trigger_cls ==
"airflow.providers.google.cloud.triggers.bigquery.BigQueryInsertJobTrigger"
+ @mock.patch(GCS_TO_BQ_PATH.format("BigQueryInsertJobTrigger"))
+ @mock.patch(GCS_TO_BQ_PATH.format("GCSToBigQueryOperator.defer"))
+ @mock.patch(GCS_TO_BQ_PATH.format("BigQueryHook"))
+ def test_execute_deferrable_hands_cancel_on_kill_to_the_trigger(self,
hook, mock_defer, trigger):
+ hook.return_value.insert_job.return_value =
MagicMock(job_id=REAL_JOB_ID, error_result=False)
+ hook.return_value.generate_job_id.return_value = REAL_JOB_ID
+ hook.return_value.split_tablename.return_value = (PROJECT_ID, DATASET,
TABLE)
+
+ operator = GCSToBigQueryOperator(
+ task_id=TASK_ID,
+ bucket=TEST_BUCKET,
+ source_objects=TEST_SOURCE_OBJECTS,
+ destination_project_dataset_table=TEST_EXPLICIT_DEST,
+ write_disposition=WRITE_DISPOSITION,
+ schema_fields=SCHEMA_FIELDS,
+ external_table=False,
+ autodetect=True,
+ deferrable=True,
+ cancel_on_kill=False,
Review Comment:
Done, parametrized over `True` and `False`. Both cases fail without the
production change, since the trigger is constructed without the keyword at all.
--
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]