File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -157,13 +157,13 @@ def gbq_dataset(self):
157
157
158
158
self .client = _get_client ()
159
159
self .dataset = self .client .dataset (dataset_id )
160
- try :
161
- # Clean-up previous test runs.
162
- self .client .delete_dataset (self .dataset , delete_contents = True )
163
- except api_exceptions .NotFound :
164
- pass # It's OK if the dataset doesn't already exist.
165
160
166
- self .client .create_dataset (bigquery .Dataset (self .dataset ))
161
+ # Ensure previous test runs are removed
162
+ self .client .delete_dataset (
163
+ self .dataset , delete_contents = True , not_found_ok = True
164
+ )
165
+
166
+ self .client .create_dataset (bigquery .Dataset (self .dataset ), exists_ok = True )
167
167
168
168
table_name = "" .join (random .choices (string .ascii_lowercase , k = 10 ))
169
169
destination_table = f"{ dataset_id } .{ table_name } "
You can’t perform that action at this time.
0 commit comments