@@ -40,6 +40,8 @@ def _setUpConstants(self):
4040 self .DATE_FORMAT = "%Y-%m-%d"
4141 self .DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S"
4242 self .TIME_ZONE = "UTC"
43+ self .TIME_FORMAT = "%H:%M:%S"
44+ self .TIMESTAMP_FORMAT = "YYYY-MM-DD HH:MM:SS.SSSSSSZ"
4345
4446 def _make_resource (self , started = False , ended = False ):
4547 resource = super (TestLoadJob , self )._make_resource (started , ended )
@@ -48,6 +50,9 @@ def _make_resource(self, started=False, ended=False):
4850 config ["dateFormat" ] = self .DATE_FORMAT
4951 config ["datetimeFormat" ] = self .DATETIME_FORMAT
5052 config ["timeZone" ] = self .TIME_ZONE
53+ config ["timeFormat" ] = self .TIME_FORMAT
54+ config ["timestampFormat" ] = self .TIMESTAMP_FORMAT
55+
5156 config ["destinationTable" ] = {
5257 "projectId" : self .PROJECT ,
5358 "datasetId" : self .DS_ID ,
@@ -169,6 +174,14 @@ def _verifyResourceProperties(self, job, resource):
169174 self .assertEqual (job .time_zone , config ["timeZone" ])
170175 else :
171176 self .assertIsNone (job .time_zone )
177+ if "timeFormat" in config :
178+ self .assertEqual (job .time_format , config ["timeFormat" ])
179+ else :
180+ self .assertIsNone (job .time_format )
181+ if "timestampFormat" in config :
182+ self .assertEqual (job .timestamp_format , config ["timestampFormat" ])
183+ else :
184+ self .assertIsNone (job .timestamp_format )
172185
173186 def test_ctor (self ):
174187 client = _make_client (project = self .PROJECT )
@@ -214,6 +227,8 @@ def test_ctor(self):
214227 self .assertIsNone (job .date_format )
215228 self .assertIsNone (job .datetime_format )
216229 self .assertIsNone (job .time_zone )
230+ self .assertIsNone (job .time_format )
231+ self .assertIsNone (job .timestamp_format )
217232
218233 def test_ctor_w_config (self ):
219234 from google .cloud .bigquery .schema import SchemaField
@@ -612,7 +627,10 @@ def test_begin_w_alternate_client(self):
612627 "dateFormat" : self .DATE_FORMAT ,
613628 "datetimeFormat" : self .DATETIME_FORMAT ,
614629 "timeZone" : self .TIME_ZONE ,
630+ "timeFormat" : self .TIME_FORMAT ,
631+ "timestampFormat" : self .TIMESTAMP_FORMAT ,
615632 }
633+
616634 RESOURCE ["configuration" ]["load" ] = LOAD_CONFIGURATION
617635 conn1 = make_connection ()
618636 client1 = _make_client (project = self .PROJECT , connection = conn1 )
@@ -643,6 +661,8 @@ def test_begin_w_alternate_client(self):
643661 config .date_format = self .DATE_FORMAT
644662 config .datetime_format = self .DATETIME_FORMAT
645663 config .time_zone = self .TIME_ZONE
664+ config .time_format = self .TIME_FORMAT
665+ config .timestamp_format = self .TIMESTAMP_FORMAT
646666
647667 with mock .patch (
648668 "google.cloud.bigquery.opentelemetry_tracing._get_final_span_attributes"
0 commit comments