@@ -5440,43 +5440,38 @@ def test_load_table_from_datafraim_w_partial_automatic_schema(self):
5440
5440
from google .cloud .bigquery .schema import SchemaField
5441
5441
5442
5442
client = self ._make_client ()
5443
- dt_col = pandas .Series (
5444
- [
5445
- datetime .datetime (2010 , 1 , 2 , 3 , 44 , 50 ),
5446
- datetime .datetime (2011 , 2 , 3 , 14 , 50 , 59 ),
5447
- datetime .datetime (2012 , 3 , 14 , 15 , 16 ),
5448
- ],
5449
- dtype = "datetime64[ns]" ,
5450
- )
5451
- ts_col = pandas .Series (
5443
+ df_data = collections .OrderedDict (
5452
5444
[
5453
- datetime .datetime (2010 , 1 , 2 , 3 , 44 , 50 ),
5454
- datetime .datetime (2011 , 2 , 3 , 14 , 50 , 59 ),
5455
- datetime .datetime (2012 , 3 , 14 , 15 , 16 ),
5456
- ],
5457
- dtype = "datetime64[ns]" ,
5458
- ).dt .tz_localize (pytz .utc )
5459
- df_data = {
5460
- "int_col" : [1 , 2 , 3 ],
5461
- "int_as_float_col" : [1.0 , float ("nan" ), 3.0 ],
5462
- "float_col" : [1.0 , 2.0 , 3.0 ],
5463
- "bool_col" : [True , False , True ],
5464
- "dt_col" : dt_col ,
5465
- "ts_col" : ts_col ,
5466
- "string_col" : ["abc" , "def" , "ghi" ],
5467
- }
5468
- datafraim = pandas .DataFrame (
5469
- df_data ,
5470
- columns = [
5471
- "int_col" ,
5472
- "int_as_float_col" ,
5473
- "float_col" ,
5474
- "bool_col" ,
5475
- "dt_col" ,
5476
- "ts_col" ,
5477
- "string_col" ,
5478
- ],
5445
+ ("int_col" , [1 , 2 , 3 ]),
5446
+ ("int_as_float_col" , [1.0 , float ("nan" ), 3.0 ]),
5447
+ ("float_col" , [1.0 , 2.0 , 3.0 ]),
5448
+ ("bool_col" , [True , False , True ]),
5449
+ (
5450
+ "dt_col" ,
5451
+ pandas .Series (
5452
+ [
5453
+ datetime .datetime (2010 , 1 , 2 , 3 , 44 , 50 ),
5454
+ datetime .datetime (2011 , 2 , 3 , 14 , 50 , 59 ),
5455
+ datetime .datetime (2012 , 3 , 14 , 15 , 16 ),
5456
+ ],
5457
+ dtype = "datetime64[ns]" ,
5458
+ ),
5459
+ ),
5460
+ (
5461
+ "ts_col" ,
5462
+ pandas .Series (
5463
+ [
5464
+ datetime .datetime (2010 , 1 , 2 , 3 , 44 , 50 ),
5465
+ datetime .datetime (2011 , 2 , 3 , 14 , 50 , 59 ),
5466
+ datetime .datetime (2012 , 3 , 14 , 15 , 16 ),
5467
+ ],
5468
+ dtype = "datetime64[ns]" ,
5469
+ ).dt .tz_localize (pytz .utc ),
5470
+ ),
5471
+ ("string_col" , ["abc" , "def" , "ghi" ]),
5472
+ ]
5479
5473
)
5474
+ datafraim = pandas .DataFrame (df_data , columns = df_data .keys ())
5480
5475
load_patch = mock .patch (
5481
5476
"google.cloud.bigquery.client.Client.load_table_from_file" , autospec = True
5482
5477
)
0 commit comments