Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion data-science-onramp/data-ingestion/ingestion_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
import re
import uuid

from google.api_core.exceptions import NotFound
from google.api_core import retry
from google.api_core.exceptions import InvalidArgument, NotFound
from google.cloud import bigquery
from google.cloud import dataproc_v1 as dataproc
from google.cloud import storage
Expand Down Expand Up @@ -154,6 +155,8 @@ def assert_table_success_message(table_name, out):
), f"Table {table_name} sucess message not printed in job logs"


# retry on InvalidArgument subnetwork not ready error
@retry.Retry(predicate=retry.if_exception_type(InvalidArgument))
def test_setup():
"""Test setup.py by submitting it to a dataproc cluster
Check table upload success message as well as data in the table itself"""
Expand Down
5 changes: 4 additions & 1 deletion data-science-onramp/data-processing/process_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import re
import uuid

from google.api_core.exceptions import NotFound
from google.api_core import retry
from google.api_core.exceptions import InvalidArgument, NotFound
from google.cloud import bigquery
from google.cloud import dataproc_v1 as dataproc
from google.cloud import storage
Expand Down Expand Up @@ -160,6 +161,8 @@ def get_blob_from_path(path):
return bucket.blob(output_location)


# retry on InvalidArgument subnetwork not ready error
@retry.Retry(predicate=retry.if_exception_type(InvalidArgument))
def test_process():
"""Tests process.py by submitting it to a Dataproc cluster"""
# Submit job to Dataproc cluster
Expand Down