@@ -238,6 +238,11 @@ def test_create_dataset(self):
238
238
self .assertEqual (dataset .dataset_id , DATASET_ID )
239
239
self .assertEqual (dataset .project , Config .CLIENT .project )
240
240
241
+ def test_create_dataset_max_time_travel_hours (self ):
242
+ DATASET_ID = _make_dataset_id ("create_ci_dataset" )
243
+ dataset = self .temp_dataset (DATASET_ID , max_time_travel_hours = 24 * 2 )
244
+ self .assertEqual (int (dataset .max_time_travel_hours ), 24 * 2 )
245
+
241
246
def test_get_dataset (self ):
242
247
dataset_id = _make_dataset_id ("get_dataset" )
243
248
client = Config .CLIENT
@@ -2286,12 +2291,14 @@ def test_nested_table_to_arrow(self):
2286
2291
self .assertTrue (pyarrow .types .is_list (record_col [1 ].type ))
2287
2292
self .assertTrue (pyarrow .types .is_int64 (record_col [1 ].type .value_type ))
2288
2293
2289
- def temp_dataset (self , dataset_id , location = None ):
2294
+ def temp_dataset (self , dataset_id , * args , ** kwargs ):
2290
2295
project = Config .CLIENT .project
2291
2296
dataset_ref = bigquery .DatasetReference (project , dataset_id )
2292
2297
dataset = Dataset (dataset_ref )
2293
- if location :
2294
- dataset .location = location
2298
+ if kwargs .get ("location" ):
2299
+ dataset .location = kwargs .get ("location" )
2300
+ if kwargs .get ("max_time_travel_hours" ):
2301
+ dataset .max_time_travel_hours = kwargs .get ("max_time_travel_hours" )
2295
2302
dataset = helpers .retry_403 (Config .CLIENT .create_dataset )(dataset )
2296
2303
self .to_delete .append (dataset )
2297
2304
return dataset
0 commit comments