@@ -1588,6 +1588,15 @@ def test_time_partitioning_setter_w_none(self):
15881588 self .assertIsNone (config .time_partitioning )
15891589 self .assertNotIn ("timePartitioning" , config ._properties ["load" ])
15901590
1591+ def test_use_avro_logical_types (self ):
1592+ config = self ._get_target_class ()()
1593+ self .assertIsNone (config .use_avro_logical_types )
1594+
1595+ def test_use_avro_logical_types_setter (self ):
1596+ config = self ._get_target_class ()()
1597+ config .use_avro_logical_types = True
1598+ self .assertTrue (config ._properties ["load" ]["useAvroLogicalTypes" ])
1599+
15911600 def test_write_disposition_missing (self ):
15921601 config = self ._get_target_class ()()
15931602 self .assertIsNone (config .write_disposition )
@@ -1663,6 +1672,10 @@ def _verifyBooleanConfigProperties(self, job, config):
16631672 self .assertEqual (job .ignore_unknown_values , config ["ignoreUnknownValues" ])
16641673 else :
16651674 self .assertIsNone (job .ignore_unknown_values )
1675+ if "useAvroLogicalTypes" in config :
1676+ self .assertEqual (job .use_avro_logical_types , config ["useAvroLogicalTypes" ])
1677+ else :
1678+ self .assertIsNone (job .use_avro_logical_types )
16661679
16671680 def _verifyEnumConfigProperties (self , job , config ):
16681681 if "createDisposition" in config :
@@ -1765,6 +1778,7 @@ def test_ctor(self):
17651778 self .assertIsNone (job .write_disposition )
17661779 self .assertIsNone (job .destination_encryption_configuration )
17671780 self .assertIsNone (job .time_partitioning )
1781+ self .assertIsNone (job .use_avro_logical_types )
17681782 self .assertIsNone (job .clustering_fields )
17691783 self .assertIsNone (job .schema_update_options )
17701784
@@ -2097,6 +2111,7 @@ def test_begin_w_alternate_client(self):
20972111 "quote" : "'" ,
20982112 "skipLeadingRows" : "1" ,
20992113 "sourceFormat" : "CSV" ,
2114+ "useAvroLogicalTypes" : True ,
21002115 "writeDisposition" : WriteDisposition .WRITE_TRUNCATE ,
21012116 "schema" : {
21022117 "fields" : [
@@ -2139,6 +2154,7 @@ def test_begin_w_alternate_client(self):
21392154 config .quote_character = "'"
21402155 config .skip_leading_rows = 1
21412156 config .source_format = "CSV"
2157+ config .use_avro_logical_types = True
21422158 config .write_disposition = WriteDisposition .WRITE_TRUNCATE
21432159 config .schema_update_options = [SchemaUpdateOption .ALLOW_FIELD_ADDITION ]
21442160
0 commit comments