Skip to content

Commit fe0a715

Browse files
committed
Changed encryption key rotation test to parameterized
1 parent 6477931 commit fe0a715

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

python/pyarrow/_parquet_encryption.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,13 +424,13 @@ cdef class CryptoFactory(_Weakrefable):
424424
encryption_config : EncryptionConfiguration
425425
Configuration of the encryption, such as which columns to encrypt
426426
427-
parquet_file_path : str, pathlib.Path or None, default None
427+
parquet_file_path : str, pathlib.Path, or None, default None
428428
Path to the parquet file to be encrypted. Only required when the
429429
internal_key_material attribute of EncryptionConfiguration is set
430430
to False. Used to derive the path for storing key material
431431
specific to this parquet file.
432432
433-
filesystem : FileSystem, default None
433+
filesystem : FileSystem or None, default None
434434
Used only when internal_key_material is set to False on
435435
EncryptionConfiguration. If None, the file system will be inferred
436436
based on parquet_file_path.
@@ -481,12 +481,12 @@ cdef class CryptoFactory(_Weakrefable):
481481
Configuration of the decryption, such as cache timeout.
482482
Can be None.
483483
484-
parquet_file_path : str, pathlib.Path or None, default None
484+
parquet_file_path : str, pathlib.Path, or None, default None
485485
Path to the parquet file to be decrypted. Only required when
486486
the parquet file uses external key material. Used to derive
487487
the path to the external key material file.
488488
489-
filesystem : FileSystem, default None
489+
filesystem : FileSystem or None, default None
490490
Used only when the parquet file uses external key material. If
491491
None, the file system will be inferred based on parquet_file_path.
492492
@@ -547,7 +547,7 @@ cdef class CryptoFactory(_Weakrefable):
547547
parquet_file_path : str or pathlib.Path
548548
Path to a parquet file using external key material.
549549
550-
filesystem : FileSystem, default None
550+
filesystem : FileSystem or None, default None
551551
Used only when the parquet file uses external key material. If
552552
None, the file system will be inferred based on parquet_file_path.
553553

python/pyarrow/tests/parquet/test_encryption.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# under the License.
1717
import pytest
1818
from datetime import timedelta
19-
from hypothesis import given, strategies as st
2019
import pyarrow as pa
2120
try:
2221
import pyarrow.parquet as pq
@@ -563,7 +562,12 @@ def test_encrypted_parquet_write_read_external(tempdir, data_table,
563562
assert data_table.equals(result_table)
564563

565564

566-
@given(double_wrap_initial=st.booleans(), double_wrap_rotated=st.booleans())
565+
@pytest.mark.parametrize(
566+
("double_wrap_initial", "double_wrap_rotated"), [
567+
pytest.param(True, True, id="double wrapping"),
568+
pytest.param(False, True, id="single to double wrapped"),
569+
pytest.param(True, False, id="double to singe wrapped"),
570+
pytest.param(False, False, id="single wrapping")])
567571
def test_external_key_material_rotation(
568572
reusable_tempdir,
569573
data_table,
@@ -576,11 +580,7 @@ def test_external_key_material_rotation(
576580
EncryptionConfig.double_wrapping was set to true (also the default) when
577581
the external key material store was written. This means double wrapping may
578582
be set one way initially and then applied or removed during rotation.
579-
When run as a regular pytest test, this function tests the default
580-
scenario - double_wrapping before and after rotation.
581-
582-
A separate wrapper test function below is driven by hypothesis strategies
583-
to run through the permutations."""
583+
"""
584584
path = reusable_tempdir / PARQUET_NAME
585585
encryption_config = pe.EncryptionConfiguration(
586586
footer_key=FOOTER_KEY_NAME,

0 commit comments

Comments
 (0)