@@ -5804,7 +5804,7 @@ def test_insert_rows_w_schema(self):
58045804 import datetime
58055805 from google .cloud ._helpers import UTC
58065806 from google .cloud ._helpers import _datetime_to_rfc3339
5807- from google .cloud ._helpers import _microseconds_from_datetime
5807+ from google .cloud ._helpers import _RFC3339_MICROS
58085808 from google .cloud .bigquery .schema import SchemaField
58095809
58105810 WHEN_TS = 1437767599.006
@@ -5834,7 +5834,7 @@ def _row_data(row):
58345834 result = {"full_name" : row [0 ], "age" : str (row [1 ])}
58355835 joined = row [2 ]
58365836 if isinstance (joined , datetime .datetime ):
5837- joined = _microseconds_from_datetime ( joined ) * 1e-6
5837+ joined = joined . strftime ( _RFC3339_MICROS )
58385838 if joined is not None :
58395839 result ["joined" ] = joined
58405840 return result
@@ -5864,7 +5864,7 @@ def test_insert_rows_w_list_of_dictionaries(self):
58645864 import datetime
58655865 from google .cloud ._helpers import UTC
58665866 from google .cloud ._helpers import _datetime_to_rfc3339
5867- from google .cloud ._helpers import _microseconds_from_datetime
5867+ from google .cloud ._helpers import _RFC3339_MICROS
58685868 from google .cloud .bigquery .schema import SchemaField
58695869 from google .cloud .bigquery .table import Table
58705870
@@ -5910,7 +5910,7 @@ def _row_data(row):
59105910 row = copy .deepcopy (row )
59115911 del row ["joined" ]
59125912 elif isinstance (joined , datetime .datetime ):
5913- row ["joined" ] = _microseconds_from_datetime ( joined ) * 1e-6
5913+ row ["joined" ] = joined . strftime ( _RFC3339_MICROS )
59145914 row ["age" ] = str (row ["age" ])
59155915 return row
59165916
@@ -6109,16 +6109,16 @@ def test_insert_rows_w_repeated_fields(self):
61096109 {
61106110 "score" : "12" ,
61116111 "times" : [
6112- 1543665600.0 , # 2018-12-01 12 :00 UTC
6113- 1543669200.0 , # 2018-12-01 13 :00 UTC
6112+ " 2018-12-01T12 :00:00.000000Z" ,
6113+ " 2018-12-01T13 :00:00.000000Z" ,
61146114 ],
61156115 "distances" : [1.25 , 2.5 ],
61166116 },
61176117 {
61186118 "score" : "13" ,
61196119 "times" : [
6120- 1543752000.0 , # 2018-12-02 12 :00 UTC
6121- 1543755600.0 , # 2018-12-02 13 :00 UTC
6120+ " 2018-12-02T12 :00:00.000000Z" ,
6121+ " 2018-12-02T13 :00:00.000000Z" ,
61226122 ],
61236123 "distances" : [- 1.25 , - 2.5 ],
61246124 },
0 commit comments