From 0a43b40c869dedaab02a6127eaef75bc2fac07fb Mon Sep 17 00:00:00 2001 From: dirrao Date: Sun, 30 Jun 2024 10:21:55 +0530 Subject: [PATCH] Resolve google data pipelines deprecations in tests --- tests/deprecations_ignore.yml | 3 --- .../google/cloud/operators/test_datapipeline.py | 14 +++++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/deprecations_ignore.yml b/tests/deprecations_ignore.yml index 36a27794cbd7f..4151eca54a399 100644 --- a/tests/deprecations_ignore.yml +++ b/tests/deprecations_ignore.yml @@ -168,9 +168,6 @@ - tests/providers/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithoutDefaultProjectIdHook::test_delete_pipeline_job - tests/providers/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithoutDefaultProjectIdHook::test_get_pipeline_job - tests/providers/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithoutDefaultProjectIdHook::test_list_pipeline_jobs -- tests/providers/google/cloud/operators/test_automl.py::TestAutoMLTrainModelOperator::test_execute -- tests/providers/google/cloud/operators/test_datapipeline.py::TestCreateDataPipelineOperator::test_execute -- tests/providers/google/cloud/operators/test_datapipeline.py::TestRunDataPipelineOperator::test_execute - tests/providers/google/cloud/operators/test_dataproc.py::TestDataProcHadoopOperator::test_execute - tests/providers/google/cloud/operators/test_dataproc.py::TestDataProcHiveOperator::test_builder - tests/providers/google/cloud/operators/test_dataproc.py::TestDataProcHiveOperator::test_execute diff --git a/tests/providers/google/cloud/operators/test_datapipeline.py b/tests/providers/google/cloud/operators/test_datapipeline.py index 1b403d67fbe6e..130b58d409a27 100644 --- a/tests/providers/google/cloud/operators/test_datapipeline.py +++ b/tests/providers/google/cloud/operators/test_datapipeline.py @@ -21,9 +21,9 @@ import pytest -from airflow.providers.google.cloud.operators.datapipeline import ( - CreateDataPipelineOperator, - RunDataPipelineOperator, +from airflow.providers.google.cloud.operators.dataflow import ( + DataflowCreatePipelineOperator, + DataflowRunPipelineOperator, ) TASK_ID = "test-datapipeline-operators" @@ -58,7 +58,7 @@ def create_operator(self): """ Creates a mock create datapipeline operator to be used in testing. """ - return CreateDataPipelineOperator( + return DataflowCreatePipelineOperator( task_id="test_create_datapipeline", body=TEST_BODY, project_id=TEST_PROJECT_ID, @@ -89,11 +89,11 @@ class TestRunDataPipelineOperator: @pytest.fixture def run_operator(self): """ - Create a RunDataPipelineOperator instance with test data + Create a DataflowRunPipelineOperator instance with test data """ - return RunDataPipelineOperator( + return DataflowRunPipelineOperator( task_id=TASK_ID, - data_pipeline_name=TEST_DATA_PIPELINE_NAME, + pipeline_name=TEST_DATA_PIPELINE_NAME, project_id=TEST_PROJECT_ID, location=TEST_LOCATION, gcp_conn_id=TEST_GCP_CONN_ID,