You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by am...@apache.org on 2022/04/13 13:25:27 UTC
[arrow] branch master updated: ARROW-15824: [Python] Make pyarrow.parquet a package
This is an automated email from the ASF dual-hosted git repository.
amolina pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 421e885234 ARROW-15824: [Python] Make pyarrow.parquet a package
421e885234 is described below
commit 421e8852344f7b184a2f7992bdc08a93c1c8f0b1
Author: Raúl Cumplido <ra...@gmail.com>
AuthorDate: Wed Apr 13 15:25:19 2022 +0200
ARROW-15824: [Python] Make pyarrow.parquet a package
This PR makes `pyarrow.parquet` a package and moves `pyarrow.parquet_encryption` to `pyarrow.parquet.encryption`
Closes #12837 from raulcd/ARROW-15824
Authored-by: Raúl Cumplido <ra...@gmail.com>
Signed-off-by: Alessandro Molina <am...@turbogears.org>
---
docs/source/python/api/formats.rst | 2 +-
docs/source/python/parquet.rst | 14 +++++++-------
.../examples/parquet_encryption/sample_vault_kms_client.py | 2 +-
python/pyarrow/{parquet.py => parquet/__init__.py} | 0
.../{parquet_encryption.py => parquet/encryption.py} | 0
python/pyarrow/tests/conftest.py | 2 +-
python/pyarrow/tests/parquet/encryption.py | 2 +-
python/pyarrow/tests/parquet/test_encryption.py | 2 +-
8 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/docs/source/python/api/formats.rst b/docs/source/python/api/formats.rst
index 82c86f6aba..55f6d568d9 100644
--- a/docs/source/python/api/formats.rst
+++ b/docs/source/python/api/formats.rst
@@ -92,7 +92,7 @@ Parquet Files
Encrypted Parquet Files
~~~~~~~~~~~~~~~~~~~~~~~
-.. currentmodule:: pyarrow.parquet_encryption
+.. currentmodule:: pyarrow.parquet.encryption
.. autosummary::
:toctree: ../generated/
diff --git a/docs/source/python/parquet.rst b/docs/source/python/parquet.rst
index a5b34d91d5..4b415ed090 100644
--- a/docs/source/python/parquet.rst
+++ b/docs/source/python/parquet.rst
@@ -634,7 +634,7 @@ Reading an encrypted Parquet file:
In order to create the encryption and decryption properties, a
-:class:`pyarrow.parquet_encryption.CryptoFactory` should be created and
+:class:`pyarrow.parquet.encryption.CryptoFactory` should be created and
initialized with KMS Client details, as described below.
@@ -645,11 +645,11 @@ The master encryption keys should be kept and managed in a production-grade
Key Management System (KMS), deployed in the user's organization. Using Parquet
encryption requires implementation of a client class for the KMS server.
Any KmsClient implementation should implement the informal interface
-defined by :class:`pyarrow.parquet_encryption.KmsClient` as following:
+defined by :class:`pyarrow.parquet.encryption.KmsClient` as following:
.. code-block:: python
- import pyarrow.parquet_encryption as pe
+ import pyarrow.parquet.encryption as pe
class MyKmsClient(pe.KmsClient):
@@ -671,7 +671,7 @@ defined by :class:`pyarrow.parquet_encryption.KmsClient` as following:
The concrete implementation will be loaded at runtime by a factory function
provided by the user. This factory function will be used to initialize the
-:class:`pyarrow.parquet_encryption.CryptoFactory` for creating file encryption
+:class:`pyarrow.parquet.encryption.CryptoFactory` for creating file encryption
and decryption properties.
For example, in order to use the ``MyKmsClient`` defined above:
@@ -696,7 +696,7 @@ above.
KMS connection configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Configuration of connection to KMS (:class:`pyarrow.parquet_encryption.KmsConnectionConfig`
+Configuration of connection to KMS (:class:`pyarrow.parquet.encryption.KmsConnectionConfig`
used when creating file encryption and decryption properties) includes the
following options:
@@ -709,7 +709,7 @@ following options:
Encryption configuration
~~~~~~~~~~~~~~~~~~~~~~~~
-:class:`pyarrow.parquet_encryption.EncryptionConfiguration` (used when
+:class:`pyarrow.parquet.encryption.EncryptionConfiguration` (used when
creating file encryption properties) includes the following options:
* ``footer_key``, the ID of the master key for footer encryption/signing.
@@ -754,7 +754,7 @@ An example encryption configuration:
Decryption configuration
~~~~~~~~~~~~~~~~~~~~~~~~
-:class:`pyarrow.parquet_encryption.DecryptionConfiguration` (used when creating
+:class:`pyarrow.parquet.encryption.DecryptionConfiguration` (used when creating
file decryption properties) is optional and it includes the following options:
* ``cache_lifetime``, the lifetime of cached entities (key encryption keys, local
diff --git a/python/examples/parquet_encryption/sample_vault_kms_client.py b/python/examples/parquet_encryption/sample_vault_kms_client.py
index 3531e79f40..bec0cc5043 100644
--- a/python/examples/parquet_encryption/sample_vault_kms_client.py
+++ b/python/examples/parquet_encryption/sample_vault_kms_client.py
@@ -24,7 +24,7 @@ import requests
import pyarrow as pa
import pyarrow.parquet as pq
-import pyarrow.parquet_encryption as pe
+import pyarrow.parquet.encryption as pe
class VaultClient(pe.KmsClient):
diff --git a/python/pyarrow/parquet.py b/python/pyarrow/parquet/__init__.py
similarity index 100%
rename from python/pyarrow/parquet.py
rename to python/pyarrow/parquet/__init__.py
diff --git a/python/pyarrow/parquet_encryption.py b/python/pyarrow/parquet/encryption.py
similarity index 100%
rename from python/pyarrow/parquet_encryption.py
rename to python/pyarrow/parquet/encryption.py
diff --git a/python/pyarrow/tests/conftest.py b/python/pyarrow/tests/conftest.py
index 37e5a81275..466b1647fd 100644
--- a/python/pyarrow/tests/conftest.py
+++ b/python/pyarrow/tests/conftest.py
@@ -145,7 +145,7 @@ except ImportError:
pass
try:
- import pyarrow.parquet_encryption # noqa
+ import pyarrow.parquet.encryption # noqa
defaults['parquet_encryption'] = True
except ImportError:
pass
diff --git a/python/pyarrow/tests/parquet/encryption.py b/python/pyarrow/tests/parquet/encryption.py
index 98885fb8fd..b0465ec6ec 100644
--- a/python/pyarrow/tests/parquet/encryption.py
+++ b/python/pyarrow/tests/parquet/encryption.py
@@ -16,7 +16,7 @@
# under the License.
import base64
-import pyarrow.parquet_encryption as pe
+import pyarrow.parquet.encryption as pe
class InMemoryKmsClient(pe.KmsClient):
diff --git a/python/pyarrow/tests/parquet/test_encryption.py b/python/pyarrow/tests/parquet/test_encryption.py
index 859d8a1360..a862ba3454 100644
--- a/python/pyarrow/tests/parquet/test_encryption.py
+++ b/python/pyarrow/tests/parquet/test_encryption.py
@@ -20,7 +20,7 @@ from datetime import timedelta
import pyarrow as pa
try:
import pyarrow.parquet as pq
- import pyarrow.parquet_encryption as pe
+ import pyarrow.parquet.encryption as pe
except ImportError:
pq = None
pe = None