@@ -1588,6 +1588,15 @@ def test_time_partitioning_setter_w_none(self):
1588
1588
self .assertIsNone (config .time_partitioning )
1589
1589
self .assertNotIn ("timePartitioning" , config ._properties ["load" ])
1590
1590
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
+
1591
1600
def test_write_disposition_missing (self ):
1592
1601
config = self ._get_target_class ()()
1593
1602
self .assertIsNone (config .write_disposition )
@@ -1663,6 +1672,10 @@ def _verifyBooleanConfigProperties(self, job, config):
1663
1672
self .assertEqual (job .ignore_unknown_values , config ["ignoreUnknownValues" ])
1664
1673
else :
1665
1674
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 )
1666
1679
1667
1680
def _verifyEnumConfigProperties (self , job , config ):
1668
1681
if "createDisposition" in config :
@@ -1765,6 +1778,7 @@ def test_ctor(self):
1765
1778
self .assertIsNone (job .write_disposition )
1766
1779
self .assertIsNone (job .destination_encryption_configuration )
1767
1780
self .assertIsNone (job .time_partitioning )
1781
+ self .assertIsNone (job .use_avro_logical_types )
1768
1782
self .assertIsNone (job .clustering_fields )
1769
1783
self .assertIsNone (job .schema_update_options )
1770
1784
@@ -2097,6 +2111,7 @@ def test_begin_w_alternate_client(self):
2097
2111
"quote" : "'" ,
2098
2112
"skipLeadingRows" : "1" ,
2099
2113
"sourceFormat" : "CSV" ,
2114
+ "useAvroLogicalTypes" : True ,
2100
2115
"writeDisposition" : WriteDisposition .WRITE_TRUNCATE ,
2101
2116
"schema" : {
2102
2117
"fields" : [
@@ -2139,6 +2154,7 @@ def test_begin_w_alternate_client(self):
2139
2154
config .quote_character = "'"
2140
2155
config .skip_leading_rows = 1
2141
2156
config .source_format = "CSV"
2157
+ config .use_avro_logical_types = True
2142
2158
config .write_disposition = WriteDisposition .WRITE_TRUNCATE
2143
2159
config .schema_update_options = [SchemaUpdateOption .ALLOW_FIELD_ADDITION ]
2144
2160
0 commit comments