(path, table, encryption_config,
kms_connection_config, crypto_factory)
| 175 | |
| 176 | |
| 177 | def write_encrypted_parquet(path, table, encryption_config, |
| 178 | kms_connection_config, crypto_factory): |
| 179 | if encryption_config.internal_key_material: |
| 180 | file_encryption_properties = crypto_factory.file_encryption_properties( |
| 181 | kms_connection_config, encryption_config) |
| 182 | else: |
| 183 | file_encryption_properties = crypto_factory.file_encryption_properties( |
| 184 | kms_connection_config, encryption_config, path) |
| 185 | assert file_encryption_properties is not None |
| 186 | with pq.ParquetWriter( |
| 187 | path, table.schema, |
| 188 | encryption_properties=file_encryption_properties) as writer: |
| 189 | writer.write_table(table) |
| 190 | |
| 191 | |
| 192 | def read_encrypted_parquet(path, decryption_config, |
no test coverage detected