Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move variable definition outside try/except block #1030

Merged
merged 2 commits into from
May 23, 2024
Merged
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
13 changes: 7 additions & 6 deletions parsons/google/google_bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,13 +1328,14 @@ def _validate_copy_inputs(self, if_exists: str, data_type: str):
raise ValueError(f"Only supports csv or json files [data_type = {data_type}]")

def _load_table_from_uri(self, source_uris, destination, job_config, **load_kwargs):
load_job = self.client.load_table_from_uri(
shaunagm marked this conversation as resolved.
Show resolved Hide resolved
source_uris=source_uris,
destination=destination,
job_config=job_config,
**load_kwargs,
)

try:
load_job = self.client.load_table_from_uri(
source_uris=source_uris,
destination=destination,
job_config=job_config,
**load_kwargs,
)
load_job.result()
return load_job
except exceptions.BadRequest as e:
Expand Down
Loading