Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Lindell committed May 8, 2024
1 parent 357e37e commit 6855da4
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions target_bigquery/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from fastavro import parse_schema, writer
from google.cloud import bigquery

# from google.cloud.bigquery import DEFAULT_RETRY

from singer_sdk.helpers._batch import (
Expand Down Expand Up @@ -398,7 +399,8 @@ def transform_record(record):
try:
result = load_job.result()
self.logger.info(
f"[{self.stream_name}][{batch_id}] result.eror { result.errors }")
f"[{self.stream_name}][{batch_id}] result.eror { result.errors }"
)
# suggested?
# result = load_job.result(DEFAULT_RETRY.with_deadline(60), 500)

Expand All @@ -423,15 +425,19 @@ def transform_record(record):

except GoogleAPICallError as e:
# Handle Google API call errors
self.logger.info(f"[{self.stream_name}][{batch_id}] Google API call error: {e}")
self.logger.info(
f"[{self.stream_name}][{batch_id}] Google API call error: {e}"
)
except TimeoutError:
# Handle timeout errors
self.logger.info(f"[{self.stream_name}][{batch_id}] Timeout error: Job did not complete in the given timeout.")
self.logger.info(
f"[{self.stream_name}][{batch_id}] Timeout error: Job did not complete in the given timeout."
)
except Exception as e:
# Handle other unexpected errors
self.logger.info(f"[{self.stream_name}][{batch_id}] An unexpected error occurred: {e}")


self.logger.info(
f"[{self.stream_name}][{batch_id}] An unexpected error occurred: {e}"
)

def process_batch_files(
self,
Expand Down

0 comments on commit 6855da4

Please sign in to comment.