File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1313# limitations under the License.
1414"""Write GarfReport to anywhere."""
1515
16- __version__ = '0.1.1 '
16+ __version__ = '0.1.2 '
Original file line number Diff line number Diff line change 2727 'Please install garf-io with BigQuery support - `pip install garf-io[bq]`'
2828 ) from e
2929
30+ import contextlib
3031import logging
3132
3233import numpy as np
@@ -117,9 +118,12 @@ def create_or_get_dataset(self) -> bigquery.Dataset:
117118 try :
118119 bq_dataset = self .client .get_dataset (self .dataset_id )
119120 except google_cloud_exceptions .NotFound :
120- bq_dataset = bigquery .Dataset (self .dataset_id )
121+ dataset_id = f'{ self .project } .{ self .dataset_id } '
122+ bq_dataset = bigquery .Dataset (dataset_id )
121123 bq_dataset .location = self .location
122- bq_dataset = self .client .create_dataset (bq_dataset , timeout = 30 )
124+ with contextlib .suppress (google_cloud_exceptions .Conflict ):
125+ bq_dataset = self .client .create_dataset (bq_dataset , timeout = 30 )
126+ logger .info ('Created new dataset %s' , dataset_id )
123127 return bq_dataset
124128
125129 @tracer .start_as_current_span ('bq.write' )
You can’t perform that action at this time.
0 commit comments