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