File tree 2 files changed +27
-0
lines changed
google/cloud/bigquery/job
2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -311,6 +311,19 @@ def null_marker(self):
311
311
def null_marker (self , value ):
312
312
self ._set_sub_prop ("nullMarker" , value )
313
313
314
+ @property
315
+ def preserve_ascii_control_characters (self ):
316
+ """Optional[bool]: Preserves the embedded ASCII control characters when sourceFormat is set to CSV.
317
+
318
+ See:
319
+ https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationLoad.FIELDS.preserve_ascii_control_characters
320
+ """
321
+ return self ._get_sub_prop ("preserveAsciiControlCharacters" )
322
+
323
+ @preserve_ascii_control_characters .setter
324
+ def preserve_ascii_control_characters (self , value ):
325
+ self ._set_sub_prop ("preserveAsciiControlCharacters" , bool (value ))
326
+
314
327
@property
315
328
def projection_fields (self ) -> Optional [List [str ]]:
316
329
"""Optional[List[str]]: If
Original file line number Diff line number Diff line change @@ -424,6 +424,20 @@ def test_null_marker_setter(self):
424
424
config .null_marker = null_marker
425
425
self .assertEqual (config ._properties ["load" ]["nullMarker" ], null_marker )
426
426
427
+ def test_preserve_ascii_control_characters_missing (self ):
428
+ config = self ._get_target_class ()()
429
+ self .assertIsNone (config .preserve_ascii_control_characters )
430
+
431
+ def test_preserve_ascii_control_characters_hit (self ):
432
+ config = self ._get_target_class ()()
433
+ config ._properties ["load" ]["preserveAsciiControlCharacters" ] = True
434
+ self .assertTrue (config .preserve_ascii_control_characters )
435
+
436
+ def test_preserve_ascii_control_characters_setter (self ):
437
+ config = self ._get_target_class ()()
438
+ config .preserve_ascii_control_characters = True
439
+ self .assertTrue (config ._properties ["load" ]["preserveAsciiControlCharacters" ])
440
+
427
441
def test_projection_fields_miss (self ):
428
442
config = self ._get_target_class ()()
429
443
self .assertIsNone (config .projection_fields )
You can’t perform that action at this time.
0 commit comments