Skip to content

Commit

Permalink
[Issue-32069] Fix name format in the batch requests (#32070)
Browse files Browse the repository at this point in the history
Co-authored-by: Hussein Awala <hussein@awala.fr>
  • Loading branch information
HaeSe0ng and hussein-awala committed Jun 22, 2023
1 parent 4797192 commit 59d64d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions airflow/providers/google/cloud/hooks/dataproc.py
Expand Up @@ -894,7 +894,7 @@ def delete_batch(
: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={
Expand Down Expand Up @@ -928,7 +928,7 @@ def get_batch(
: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={
Expand Down Expand Up @@ -1712,7 +1712,7 @@ async def delete_batch(
: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={
Expand Down Expand Up @@ -1746,7 +1746,7 @@ async def get_batch(
: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={
Expand Down
2 changes: 1 addition & 1 deletion tests/providers/google/cloud/hooks/test_dataproc.py
Expand Up @@ -54,7 +54,7 @@
}
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.{}"
Expand Down

0 comments on commit 59d64d8

Please sign in to comment.