@@ -130,7 +130,7 @@ class ClusterGenerator:
130
130
:type internal_ip_only: bool
131
131
:param tags: The GCE tags to add to all instances
132
132
:type tags: list[str]
133
- :param region: leave as 'global', might become relevant in the future. (templated)
133
+ :param region: The specified region where the dataproc cluster is created.
134
134
:type region: str
135
135
:param gcp_conn_id: The connection ID to use connecting to Google Cloud.
136
136
:type gcp_conn_id: str
@@ -420,7 +420,7 @@ class DataprocCreateClusterOperator(BaseOperator):
420
420
If a dict is provided, it must be of the same form as the protobuf message
421
421
:class:`~google.cloud.dataproc_v1.types.ClusterConfig`
422
422
:type cluster_config: Union[Dict, google.cloud.dataproc_v1.types.ClusterConfig]
423
- :param region: leave as 'global', might become relevant in the future. (templated)
423
+ :param region: The specified region where the dataproc cluster is created.
424
424
:type region: str
425
425
:parm delete_on_error: If true the cluster will be deleted if created with ERROR state. Default
426
426
value is true.
@@ -466,7 +466,7 @@ def __init__( # pylint: disable=too-many-arguments
466
466
self ,
467
467
* ,
468
468
cluster_name : str ,
469
- region : str = 'global' ,
469
+ region : Optional [ str ] = None ,
470
470
project_id : Optional [str ] = None ,
471
471
cluster_config : Optional [Dict ] = None ,
472
472
labels : Optional [Dict ] = None ,
@@ -480,6 +480,14 @@ def __init__( # pylint: disable=too-many-arguments
480
480
impersonation_chain : Optional [Union [str , Sequence [str ]]] = None ,
481
481
** kwargs ,
482
482
) -> None :
483
+ if region is None :
484
+ warnings .warn (
485
+ "Default region value `global` will be deprecated. Please, provide region value." ,
486
+ DeprecationWarning ,
487
+ stacklevel = 2 ,
488
+ )
489
+ region = 'global'
490
+
483
491
# TODO: remove one day
484
492
if cluster_config is None :
485
493
warnings .warn (
@@ -916,7 +924,7 @@ def __init__(
916
924
gcp_conn_id : str = 'google_cloud_default' ,
917
925
delegate_to : Optional [str ] = None ,
918
926
labels : Optional [Dict ] = None ,
919
- region : str = 'global' ,
927
+ region : Optional [ str ] = None ,
920
928
job_error_states : Optional [Set [str ]] = None ,
921
929
impersonation_chain : Optional [Union [str , Sequence [str ]]] = None ,
922
930
asynchronous : bool = False ,
@@ -930,7 +938,16 @@ def __init__(
930
938
self .cluster_name = cluster_name
931
939
self .dataproc_properties = dataproc_properties
932
940
self .dataproc_jars = dataproc_jars
941
+
942
+ if region is None :
943
+ warnings .warn (
944
+ "Default region value `global` will be deprecated. Please, provide region value." ,
945
+ DeprecationWarning ,
946
+ stacklevel = 2 ,
947
+ )
948
+ region = 'global'
933
949
self .region = region
950
+
934
951
self .job_error_states = job_error_states if job_error_states is not None else {'ERROR' }
935
952
self .impersonation_chain = impersonation_chain
936
953
@@ -1549,7 +1566,7 @@ class DataprocInstantiateWorkflowTemplateOperator(BaseOperator):
1549
1566
:param project_id: The ID of the google cloud project in which
1550
1567
the template runs
1551
1568
:type project_id: str
1552
- :param region: leave as 'global', might become relevant in the future
1569
+ :param region: The specified region where the dataproc cluster is created.
1553
1570
:type region: str
1554
1571
:param parameters: a map of parameters for Dataproc Template in key-value format:
1555
1572
map (key: string, value: string)
@@ -1651,7 +1668,7 @@ class DataprocInstantiateInlineWorkflowTemplateOperator(BaseOperator):
1651
1668
:param project_id: The ID of the google cloud project in which
1652
1669
the template runs
1653
1670
:type project_id: str
1654
- :param region: leave as 'global', might become relevant in the future
1671
+ :param region: The specified region where the dataproc cluster is created.
1655
1672
:type region: str
1656
1673
:param parameters: a map of parameters for Dataproc Template in key-value format:
1657
1674
map (key: string, value: string)
0 commit comments