Skip to content

Commit 370bfff

Browse files
author
Lukasz Wyszomirski
committed
Upgrade the Dataproc package to 3.0.0 and migrate from v1beta2 to v1 api
1 parent 3928eec commit 370bfff

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

airflow/providers/google/cloud/hooks/dataproc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
from google.api_core.exceptions import ServerError
2727
from google.api_core.retry import Retry
28-
from google.cloud.dataproc_v1beta2 import (
28+
from google.cloud.dataproc_v1 import (
2929
Cluster,
3030
ClusterControllerClient,
3131
Job,

airflow/providers/google/cloud/operators/dataproc.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
from google.api_core.exceptions import AlreadyExists, NotFound
3232
from google.api_core.retry import Retry, exponential_sleep_generator
33-
from google.cloud.dataproc_v1beta2 import Cluster
33+
from google.cloud.dataproc_v1 import Cluster
3434
from google.protobuf.duration_pb2 import Duration
3535
from google.protobuf.field_mask_pb2 import FieldMask
3636

@@ -1906,7 +1906,7 @@ class DataprocSubmitJobOperator(BaseOperator):
19061906
:type location: str
19071907
:param job: Required. The job resource.
19081908
If a dict is provided, it must be of the same form as the protobuf message
1909-
:class:`~google.cloud.dataproc_v1beta2.types.Job`
1909+
:class:`~google.cloud.dataproc_v1.types.Job`
19101910
:type job: Dict
19111911
:param request_id: Optional. A unique id used to identify the request. If the server receives two
19121912
``SubmitJobRequest`` requests with the same id, then the second request will be ignored and the first
@@ -2047,8 +2047,8 @@ class DataprocUpdateClusterOperator(BaseOperator):
20472047
:param cluster: Required. The changes to the cluster.
20482048
20492049
If a dict is provided, it must be of the same form as the protobuf message
2050-
:class:`~google.cloud.dataproc_v1beta2.types.Cluster`
2051-
:type cluster: Union[Dict, google.cloud.dataproc_v1beta2.types.Cluster]
2050+
:class:`~google.cloud.dataproc_v1.types.Cluster`
2051+
:type cluster: Union[Dict, google.cloud.dataproc_v1.types.Cluster]
20522052
:param update_mask: Required. Specifies the path, relative to ``Cluster``, of the field to update. For
20532053
example, to change the number of workers in a cluster to 5, the ``update_mask`` parameter would be
20542054
specified as ``config.worker_config.num_instances``, and the ``PATCH`` request body would specify the

airflow/providers/google/cloud/sensors/dataproc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import warnings
2121
from typing import Optional
2222

23-
from google.cloud.dataproc_v1beta2.types import JobStatus
23+
from google.cloud.dataproc_v1.types import JobStatus
2424

2525
from airflow.exceptions import AirflowException
2626
from airflow.providers.google.cloud.hooks.dataproc import DataprocHook

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def write_version(filename: str = os.path.join(*[my_dir, "airflow", "git_version
303303
'google-cloud-build>=3.0.0,<4.0.0',
304304
'google-cloud-container>=0.1.1,<2.0.0',
305305
'google-cloud-datacatalog>=3.0.0,<4.0.0',
306-
'google-cloud-dataproc>=2.2.0,<2.6.0',
306+
'google-cloud-dataproc>=2.2.0,<4.0.0',
307307
'google-cloud-dlp>=0.11.0,<2.0.0',
308308
'google-cloud-kms>=2.0.0,<3.0.0',
309309
'google-cloud-language>=1.1.1,<2.0.0',

tests/providers/google/cloud/hooks/test_dataproc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from unittest import mock
2121

2222
import pytest
23-
from google.cloud.dataproc_v1beta2 import JobStatus
23+
from google.cloud.dataproc_v1 import JobStatus
2424

2525
from airflow.exceptions import AirflowException
2626
from airflow.providers.google.cloud.hooks.dataproc import DataprocHook, DataProcJobBuilder

tests/providers/google/cloud/sensors/test_dataproc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from unittest import mock
2020

2121
import pytest
22-
from google.cloud.dataproc_v1beta2.types import JobStatus
22+
from google.cloud.dataproc_v1.types import JobStatus
2323

2424
from airflow import AirflowException
2525
from airflow.providers.google.cloud.sensors.dataproc import DataprocJobSensor

0 commit comments

Comments
 (0)