SameerMesiah97 commented on code in PR #70922:
URL: https://github.com/apache/airflow/pull/70922#discussion_r3696541184
##########
providers/google/tests/unit/google/cloud/operators/test_dataproc.py:
##########
@@ -998,6 +998,20 @@ def test_deprecation_warning(self):
assert op.project_id == GCP_PROJECT
assert op.cluster_name == "cluster_name"
+ assert op.cluster_config is None
+ assert op._legacy_cluster_kwargs["num_workers"] == 2
+ assert op._legacy_cluster_kwargs["zone"] == "zone"
+
+ @mock.patch(DATAPROC_PATH.format("Cluster.to_dict"))
+ @mock.patch(DATAPROC_PATH.format("DataprocHook"))
+ def test_deprecated_kwargs_cluster_config_built_in_execute(self,
mock_hook, to_dict_mock):
+ mock_hook.return_value.create_cluster.result.return_value = None
+ op = DataprocCreateClusterOperator(
+ task_id=TASK_ID, region=GCP_REGION, project_id=GCP_PROJECT,
+ cluster_name="cluster_name", num_workers=2, zone="zone",
Review Comment:
The formatting of these arguments should be fixed by the linter.
##########
providers/google/tests/unit/google/cloud/operators/test_dataproc.py:
##########
@@ -998,6 +998,20 @@ def test_deprecation_warning(self):
assert op.project_id == GCP_PROJECT
assert op.cluster_name == "cluster_name"
+ assert op.cluster_config is None
+ assert op._legacy_cluster_kwargs["num_workers"] == 2
+ assert op._legacy_cluster_kwargs["zone"] == "zone"
+
+ @mock.patch(DATAPROC_PATH.format("Cluster.to_dict"))
+ @mock.patch(DATAPROC_PATH.format("DataprocHook"))
+ def test_deprecated_kwargs_cluster_config_built_in_execute(self,
mock_hook, to_dict_mock):
+ mock_hook.return_value.create_cluster.result.return_value = None
+ op = DataprocCreateClusterOperator(
Review Comment:
I think you need to wrap the operator construction like this in both tests
to fix failing CI:
```
with pytest.warns(AirflowProviderDeprecationWarning):
op = DataprocCreateClusterOperator(...)
```
--
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]