(path, table, encryption_config,
kms_connection_config, crypto_factory)
| 182 | |
| 183 | |
| 184 | def write_encrypted_parquet(path, table, encryption_config, |
| 185 | kms_connection_config, crypto_factory): |
| 186 | if encryption_config.internal_key_material: |
| 187 | file_encryption_properties = crypto_factory.file_encryption_properties( |
| 188 | kms_connection_config, encryption_config) |
| 189 | else: |
| 190 | file_encryption_properties = crypto_factory.file_encryption_properties( |
| 191 | kms_connection_config, encryption_config, path) |
| 192 | assert file_encryption_properties is not None |
| 193 | with pq.ParquetWriter( |
| 194 | path, table.schema, |
| 195 | encryption_properties=file_encryption_properties) as writer: |
| 196 | writer.write_table(table) |
| 197 | |
| 198 | |
| 199 | def read_encrypted_parquet(path, decryption_config, |
no test coverage detected