Make region parameter required in Google Dataproc operators and hooks
See original GitHub issueDescription
Deprecate using global
as the default region
value in Google Dataproc operators and hooks. Make the default value None
and then check if another value was passed. If not then raise a warning and set the value to global
to preserve backward compatibility. Example of how it can be done:
https://github.com/apache/airflow/blob/805781b024fdcc8e93d695443b49d96747c085bf/airflow/providers/google/cloud/hooks/bigquery.py#L81-L90
Also, it would make sense to make this change only in not-deprecated operators and hook’s methods.
That is DataprocDeleteClusterOperator
, DataprocInstantiateWorkflowTemplateOperator
, DataprocInstantiateInlineWorkflowTemplateOperator
.
Use case / motivation
This parameter should be required by operators because running in any default (unexpected) region may be seen as undesirable behavior.
Related Issues
https://github.com/apache/airflow/pull/10673#discussion_r481057300
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
I’ve made my first PR 💪 (https://github.com/apache/airflow/pull/10772). There was
submit
method in dataproc hooks that is going to be deprecated, so I left it without changes. Also, I’ve ignoredDataprocScaleClusterOperator
in dataproc operators for the same reason, but, added condition toDataprocJobBaseOperator
. I can see that operators that inherits this class are going to be deprecated, but I guess they are still in use to generate input for new operatorDataprocSubmitJobOperator
.Awesome @dmitrikuksik, I assigned you 👌
The renaming of
region
->location
is not a part of this issue, I just wanted to raise the question as it’s a recurring problem and there was no agreement.