@@ -37,14 +37,14 @@ def _setUpConstants(self):
3737 self .OUTPUT_BYTES = 23456
3838 self .OUTPUT_ROWS = 345
3939 self .REFERENCE_FILE_SCHEMA_URI = "gs://path/to/reference"
40-
40+ self . DATE_FORMAT = "%Y-%m-%d"
4141 self .TIME_ZONE = "UTC"
4242
4343 def _make_resource (self , started = False , ended = False ):
4444 resource = super (TestLoadJob , self )._make_resource (started , ended )
4545 config = resource ["configuration" ]["load" ]
4646 config ["sourceUris" ] = [self .SOURCE1 ]
47-
47+ config [ "dateFormat" ] = self . DATE_FORMAT
4848 config ["timeZone" ] = self .TIME_ZONE
4949 config ["destinationTable" ] = {
5050 "projectId" : self .PROJECT ,
@@ -147,7 +147,6 @@ def _verifyResourceProperties(self, job, resource):
147147 )
148148 else :
149149 self .assertIsNone (job .reference_file_schema_uri )
150-
151150 if "destinationEncryptionConfiguration" in config :
152151 self .assertIsNotNone (job .destination_encryption_configuration )
153152 self .assertEqual (
@@ -156,6 +155,10 @@ def _verifyResourceProperties(self, job, resource):
156155 )
157156 else :
158157 self .assertIsNone (job .destination_encryption_configuration )
158+ if "dateFormat" in config :
159+ self .assertEqual (job .date_format , config ["dateFormat" ])
160+ else :
161+ self .assertIsNone (job .date_format )
159162 if "timeZone" in config :
160163 self .assertEqual (job .time_zone , config ["timeZone" ])
161164 else :
@@ -202,7 +205,7 @@ def test_ctor(self):
202205 self .assertIsNone (job .clustering_fields )
203206 self .assertIsNone (job .schema_update_options )
204207 self .assertIsNone (job .reference_file_schema_uri )
205-
208+ self . assertIsNone ( job . date_format )
206209 self .assertIsNone (job .time_zone )
207210
208211 def test_ctor_w_config (self ):
@@ -599,6 +602,7 @@ def test_begin_w_alternate_client(self):
599602 ]
600603 },
601604 "schemaUpdateOptions" : [SchemaUpdateOption .ALLOW_FIELD_ADDITION ],
605+ "dateFormat" : self .DATE_FORMAT ,
602606 "timeZone" : self .TIME_ZONE ,
603607 }
604608 RESOURCE ["configuration" ]["load" ] = LOAD_CONFIGURATION
@@ -628,7 +632,7 @@ def test_begin_w_alternate_client(self):
628632 config .write_disposition = WriteDisposition .WRITE_TRUNCATE
629633 config .schema_update_options = [SchemaUpdateOption .ALLOW_FIELD_ADDITION ]
630634 config .reference_file_schema_uri = "gs://path/to/reference"
631-
635+ config . date_format = self . DATE_FORMAT
632636 config .time_zone = self .TIME_ZONE
633637
634638 with mock .patch (
0 commit comments