MCPcopy Create free account
hub / github.com/apache/arrow / write_encrypted_file

Function write_encrypted_file

python/pyarrow/tests/parquet/test_encryption.py:102–121  ·  view source on GitHub ↗

Writes an encrypted parquet file based on the provided parameters.

(path, data_table, footer_key_name, col_key_name,
                         footer_key, col_key, encryption_config)

Source from the content-addressed store, hash-verified

100
101
102def write_encrypted_file(path, data_table, footer_key_name, col_key_name,
103 footer_key, col_key, encryption_config):
104 """
105 Writes an encrypted parquet file based on the provided parameters.
106 """
107 # Setup the custom KMS configuration with provided keys
108 custom_kms_conf = {
109 footer_key_name: footer_key.decode("UTF-8"),
110 col_key_name: col_key.decode("UTF-8"),
111 }
112
113 # Setup encryption environment
114 kms_connection_config, crypto_factory = setup_encryption_environment(
115 custom_kms_conf)
116
117 # Write the encrypted parquet file
118 write_encrypted_parquet(path, data_table, encryption_config,
119 kms_connection_config, crypto_factory)
120
121 return kms_connection_config, crypto_factory
122
123
124def test_encrypted_parquet_write_read(tempdir, data_table):

Calls 3

write_encrypted_parquetFunction · 0.85
decodeMethod · 0.45

Tested by

no test coverage detected