pankajastro commented on code in PR #31082:
URL: https://github.com/apache/airflow/pull/31082#discussion_r1186096002
##########
tests/providers/google/cloud/operators/test_dataflow.py:
##########
@@ -534,6 +535,42 @@ def test_validation_deferrable_params_raises_error(self):
with pytest.raises(ValueError):
DataflowTemplatedJobStartOperator(**init_kwargs)
+
@mock.patch("airflow.providers.google.cloud.operators.dataflow.DataflowHook.start_template_dataflow")
+ def test_start_with_custom_region(self, dataflow_mock):
+ init_kwargs = {
+ "task_id": TASK_ID,
+ "template": TEMPLATE,
+ "dataflow_default_options": {
+ "region": TEST_REGION,
+ },
+ "poll_sleep": POLL_SLEEP,
+ "wait_until_finished": True,
+ "cancel_timeout": CANCEL_TIMEOUT,
+ }
+ operator = DataflowTemplatedJobStartOperator(**init_kwargs)
+ operator.execute(None)
+ assert dataflow_mock.called
+ _, kwargs = dataflow_mock.call_args_list[0]
+ assert kwargs["variables"]["region"] == TEST_REGION
+ assert kwargs["location"] == None
Review Comment:
```suggestion
assert kwargs["location"] is None
```
--
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]