Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
fix: Wrap BigQuery jobs in exception handler and fix tests (#479)
Browse files Browse the repository at this point in the history
* Exclude models that break on bigquery

* wrap bigquery client call with exception handler
  • Loading branch information
chamini2 authored Jul 26, 2022
1 parent b3020ef commit 3546f6d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion integration_tests/features/write_to_model_function.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: `write_to_model` function
Scenario: Use write_to_model and write_to_source_twice function with mode overwrite
When the following command is invoked:
"""
fal flow run --profiles-dir $profilesDir --project-dir $baseDir
fal flow run --profiles-dir $profilesDir --project-dir $baseDir --exclude model_with_date model_with_array
"""
Then the following models are calculated:
| other_model | some_model | third_model |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: `write_to_source` function
Scenario: Use write_to_source function with mode append and overwrite
When the following command is invoked:
"""
fal flow run --profiles-dir $profilesDir --project-dir $baseDir
fal flow run --profiles-dir $profilesDir --project-dir $baseDir --exclude model_with_date model_with_array
"""
Then the following models are calculated:
| other_model | some_model | third_model |
Expand Down
5 changes: 4 additions & 1 deletion src/faldbt/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,10 @@ def _bigquery_write_relation(
write_disposition=disposition,
)

job = client.load_table_from_dataframe(data, table_ref, job_config=job_config)
with connection_manager.exception_handler("START JOB"):
job = client.load_table_from_dataframe(
data, table_ref, job_config=job_config
)

from dbt.adapters.bigquery.__version__ import version as bigquery_version

Expand Down

0 comments on commit 3546f6d

Please sign in to comment.