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

Function verify_file_encrypted

python/pyarrow/tests/parquet/encryption.py:109–116  ·  view source on GitHub ↗

Verify that the file is encrypted by looking at its first 4 bytes. If it's the magic string PARE then this is a parquet with encrypted footer.

(path)

Source from the content-addressed store, hash-verified

107
108
109def verify_file_encrypted(path):
110 """Verify that the file is encrypted by looking at its first 4 bytes.
111 If it's the magic string PARE
112 then this is a parquet with encrypted footer."""
113 with open(path, "rb") as file:
114 magic_str = file.read(4)
115 # Verify magic string for parquet with encrypted footer is PARE
116 assert magic_str == b'PARE'
117
118
119def read_external_keys_to_dict(path):

Calls 1

readMethod · 0.45