This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 59d64d8f2e [Issue-32069] Fix name format in the batch requests (#32070)
59d64d8f2e is described below
commit 59d64d8f2ed3c0e7b93d3c07041d47883cabb908
Author: Haeseong Je <[email protected]>
AuthorDate: Fri Jun 23 06:20:44 2023 +0900
[Issue-32069] Fix name format in the batch requests (#32070)
Co-authored-by: Hussein Awala <[email protected]>
---
airflow/providers/google/cloud/hooks/dataproc.py | 8 ++++----
tests/providers/google/cloud/hooks/test_dataproc.py | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/airflow/providers/google/cloud/hooks/dataproc.py
b/airflow/providers/google/cloud/hooks/dataproc.py
index cc59dc8d72..19e711c263 100644
--- a/airflow/providers/google/cloud/hooks/dataproc.py
+++ b/airflow/providers/google/cloud/hooks/dataproc.py
@@ -894,7 +894,7 @@ class DataprocHook(GoogleBaseHook):
:param metadata: Additional metadata that is provided to the method.
"""
client = self.get_batch_client(region)
- name = f"projects/{project_id}/regions/{region}/batches/{batch_id}"
+ name = f"projects/{project_id}/locations/{region}/batches/{batch_id}"
client.delete_batch(
request={
@@ -928,7 +928,7 @@ class DataprocHook(GoogleBaseHook):
:param metadata: Additional metadata that is provided to the method.
"""
client = self.get_batch_client(region)
- name = f"projects/{project_id}/regions/{region}/batches/{batch_id}"
+ name = f"projects/{project_id}/locations/{region}/batches/{batch_id}"
result = client.get_batch(
request={
@@ -1712,7 +1712,7 @@ class DataprocAsyncHook(GoogleBaseHook):
:param metadata: Additional metadata that is provided to the method.
"""
client = self.get_batch_client(region)
- name = f"projects/{project_id}/regions/{region}/batches/{batch_id}"
+ name = f"projects/{project_id}/locations/{region}/batches/{batch_id}"
await client.delete_batch(
request={
@@ -1746,7 +1746,7 @@ class DataprocAsyncHook(GoogleBaseHook):
:param metadata: Additional metadata that is provided to the method.
"""
client = self.get_batch_client(region)
- name = f"projects/{project_id}/regions/{region}/batches/{batch_id}"
+ name = f"projects/{project_id}/locations/{region}/batches/{batch_id}"
result = await client.get_batch(
request={
diff --git a/tests/providers/google/cloud/hooks/test_dataproc.py
b/tests/providers/google/cloud/hooks/test_dataproc.py
index b5233dc37e..1957e28d7c 100644
--- a/tests/providers/google/cloud/hooks/test_dataproc.py
+++ b/tests/providers/google/cloud/hooks/test_dataproc.py
@@ -54,7 +54,7 @@ CLUSTER = {
}
BATCH = {"batch": "test-batch"}
BATCH_ID = "batch-id"
-BATCH_NAME = "projects/{}/regions/{}/batches/{}"
+BATCH_NAME = "projects/{}/locations/{}/batches/{}"
PARENT = "projects/{}/regions/{}"
BASE_STRING = "airflow.providers.google.common.hooks.base_google.{}"