@@ -109,7 +109,7 @@ def write_encrypted_parquet(path, table, encryption_config,
109
109
kms_connection_config , crypto_factory ):
110
110
file_encryption_properties = crypto_factory .file_encryption_properties (
111
111
kms_connection_config , encryption_config )
112
- assert ( file_encryption_properties is not None )
112
+ assert file_encryption_properties is not None
113
113
with pq .ParquetWriter (
114
114
path , table .schema ,
115
115
encryption_properties = file_encryption_properties ) as writer :
@@ -120,13 +120,13 @@ def read_encrypted_parquet(path, decryption_config,
120
120
kms_connection_config , crypto_factory ):
121
121
file_decryption_properties = crypto_factory .file_decryption_properties (
122
122
kms_connection_config , decryption_config )
123
- assert ( file_decryption_properties is not None )
123
+ assert file_decryption_properties is not None
124
124
meta = pq .read_metadata (
125
125
path , decryption_properties = file_decryption_properties )
126
- assert ( meta .num_columns == 3 )
126
+ assert meta .num_columns == 3
127
127
schema = pq .read_schema (
128
128
path , decryption_properties = file_decryption_properties )
129
- assert ( len (schema .names ) == 3 )
129
+ assert len (schema .names ) == 3
130
130
131
131
result = pq .ParquetFile (
132
132
path , decryption_properties = file_decryption_properties )
@@ -350,14 +350,14 @@ def kms_factory(kms_connection_configuration):
350
350
351
351
def test_encrypted_parquet_encryption_configuration ():
352
352
def validate_encryption_configuration (encryption_config ):
353
- assert ( FOOTER_KEY_NAME == encryption_config .footer_key )
354
- assert ( ["a" , "b" ] == encryption_config .column_keys [COL_KEY_NAME ])
355
- assert ( "AES_GCM_CTR_V1" == encryption_config .encryption_algorithm )
356
- assert ( encryption_config .plaintext_footer )
357
- assert ( not encryption_config .double_wrapping )
358
- assert ( timedelta (minutes = 10.0 ) == encryption_config .cache_lifetime )
359
- assert ( not encryption_config .internal_key_material )
360
- assert ( 192 == encryption_config .data_key_length_bits )
353
+ assert FOOTER_KEY_NAME == encryption_config .footer_key
354
+ assert ["a" , "b" ] == encryption_config .column_keys [COL_KEY_NAME ]
355
+ assert "AES_GCM_CTR_V1" == encryption_config .encryption_algorithm
356
+ assert encryption_config .plaintext_footer
357
+ assert not encryption_config .double_wrapping
358
+ assert timedelta (minutes = 10.0 ) == encryption_config .cache_lifetime
359
+ assert not encryption_config .internal_key_material
360
+ assert 192 == encryption_config .data_key_length_bits
361
361
362
362
encryption_config = pe .EncryptionConfiguration (
363
363
footer_key = FOOTER_KEY_NAME ,
@@ -386,20 +386,20 @@ def validate_encryption_configuration(encryption_config):
386
386
def test_encrypted_parquet_decryption_configuration ():
387
387
decryption_config = pe .DecryptionConfiguration (
388
388
cache_lifetime = timedelta (minutes = 10.0 ))
389
- assert ( timedelta (minutes = 10.0 ) == decryption_config .cache_lifetime )
389
+ assert timedelta (minutes = 10.0 ) == decryption_config .cache_lifetime
390
390
391
391
decryption_config_1 = pe .DecryptionConfiguration ()
392
392
decryption_config_1 .cache_lifetime = timedelta (minutes = 10.0 )
393
- assert ( timedelta (minutes = 10.0 ) == decryption_config_1 .cache_lifetime )
393
+ assert timedelta (minutes = 10.0 ) == decryption_config_1 .cache_lifetime
394
394
395
395
396
396
def test_encrypted_parquet_kms_configuration ():
397
397
def validate_kms_connection_config (kms_connection_config ):
398
- assert ( "Instance1" == kms_connection_config .kms_instance_id )
399
- assert ( "URL1" == kms_connection_config .kms_instance_url )
400
- assert ( "MyToken" == kms_connection_config .key_access_token )
401
- assert ({"key1" : "key_material_1" , "key2" : "key_material_2" } ==
402
- kms_connection_config .custom_kms_conf )
398
+ assert "Instance1" == kms_connection_config .kms_instance_id
399
+ assert "URL1" == kms_connection_config .kms_instance_url
400
+ assert "MyToken" == kms_connection_config .key_access_token
401
+ assert ({"key1" : "key_material_1" , "key2" : "key_material_2" } ==
402
+ kms_connection_config .custom_kms_conf )
403
403
404
404
kms_connection_config = pe .KmsConnectionConfig (
405
405
kms_instance_id = "Instance1" ,
@@ -524,7 +524,7 @@ def kms_factory(kms_connection_configuration):
524
524
# Read with decryption properties
525
525
file_decryption_properties = crypto_factory .file_decryption_properties (
526
526
kms_connection_config , decryption_config )
527
- assert ( file_decryption_properties is not None )
527
+ assert file_decryption_properties is not None
528
528
529
529
result = pq .ParquetFile (
530
530
path , decryption_properties = file_decryption_properties )
0 commit comments