PyAthena 3.32.0__tar.gz → 3.34.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyathena-3.32.0 → pyathena-3.34.0}/PKG-INFO +2 -2
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/_version.py +2 -2
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/arrow/result_set.py +2 -2
- pyathena-3.34.0/pyathena/filesystem/__init__.py +35 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/filesystem/s3.py +893 -181
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/filesystem/s3_async.py +53 -3
- pyathena-3.34.0/pyathena/filesystem/s3_errors.py +141 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/filesystem/s3_object.py +259 -2
- pyathena-3.34.0/pyathena/pandas/__init__.py +3 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/pandas/result_set.py +10 -12
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/pandas/util.py +1 -1
- pyathena-3.34.0/pyathena/polars/__init__.py +3 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/polars/result_set.py +5 -5
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/result_set.py +1 -1
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/s3fs/result_set.py +1 -1
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/spark/common.py +1 -1
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/sqlalchemy/base.py +7 -2
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/sqlalchemy/compiler.py +95 -13
- {pyathena-3.32.0 → pyathena-3.34.0}/pyproject.toml +6 -5
- pyathena-3.32.0/pyathena/pandas/__init__.py +0 -4
- pyathena-3.32.0/pyathena/polars/__init__.py +0 -4
- pyathena-3.32.0/pyathena/sqlalchemy/__init__.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/.gitignore +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/LICENSE +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/README.md +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/__init__.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/__init__.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/arrow/__init__.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/arrow/cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/common.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/connection.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/pandas/__init__.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/pandas/cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/polars/__init__.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/polars/cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/result_set.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/s3fs/__init__.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/s3fs/cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/spark/__init__.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/spark/cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/sqlalchemy/__init__.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/sqlalchemy/arrow.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/sqlalchemy/base.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/sqlalchemy/pandas.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/sqlalchemy/polars.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/sqlalchemy/rest.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/sqlalchemy/s3fs.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/aio/util.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/arrow/__init__.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/arrow/async_cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/arrow/converter.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/arrow/cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/arrow/util.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/async_cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/common.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/connection.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/converter.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/error.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/filesystem/s3_executor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/formatter.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/model.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/pandas/async_cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/pandas/converter.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/pandas/cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/parser.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/polars/async_cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/polars/converter.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/polars/cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/polars/util.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/py.typed +0 -0
- {pyathena-3.32.0/pyathena/filesystem → pyathena-3.34.0/pyathena/s3fs}/__init__.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/s3fs/async_cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/s3fs/converter.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/s3fs/cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/s3fs/reader.py +0 -0
- {pyathena-3.32.0/pyathena/s3fs → pyathena-3.34.0/pyathena/spark}/__init__.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/spark/async_cursor.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/spark/cursor.py +0 -0
- {pyathena-3.32.0/pyathena/spark → pyathena-3.34.0/pyathena/sqlalchemy}/__init__.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/sqlalchemy/arrow.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/sqlalchemy/constants.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/sqlalchemy/pandas.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/sqlalchemy/polars.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/sqlalchemy/preparer.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/sqlalchemy/requirements.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/sqlalchemy/rest.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/sqlalchemy/s3fs.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/sqlalchemy/types.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/sqlalchemy/util.py +0 -0
- {pyathena-3.32.0 → pyathena-3.34.0}/pyathena/util.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyAthena
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.34.0
|
|
4
4
|
Summary: Python DB API 2.0 (PEP 249) client for Amazon Athena
|
|
5
5
|
Project-URL: homepage, https://github.com/pyathena-dev/PyAthena/
|
|
6
6
|
Project-URL: repository, https://github.com/pyathena-dev/PyAthena/
|
|
@@ -38,7 +38,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
38
38
|
Classifier: Programming Language :: Python :: 3.14
|
|
39
39
|
Classifier: Topic :: Database :: Front-Ends
|
|
40
40
|
Requires-Python: >=3.10
|
|
41
|
-
Requires-Dist: boto3>=1.
|
|
41
|
+
Requires-Dist: boto3>=1.41.2
|
|
42
42
|
Requires-Dist: botocore>=1.41.2
|
|
43
43
|
Requires-Dist: fsspec
|
|
44
44
|
Requires-Dist: python-dateutil
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '3.
|
|
22
|
-
__version_tuple__ = version_tuple = (3,
|
|
21
|
+
__version__ = version = '3.34.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (3, 34, 0)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -315,7 +315,7 @@ class AthenaArrowResultSet(AthenaResultSet):
|
|
|
315
315
|
),
|
|
316
316
|
)
|
|
317
317
|
except Exception as e:
|
|
318
|
-
_logger.exception("Failed to read
|
|
318
|
+
_logger.exception(f"Failed to read {bucket}/{key}.")
|
|
319
319
|
raise OperationalError(*e.args) from e
|
|
320
320
|
|
|
321
321
|
def _read_parquet(self) -> Table:
|
|
@@ -333,7 +333,7 @@ class AthenaArrowResultSet(AthenaResultSet):
|
|
|
333
333
|
dataset = parquet.ParquetDataset(f"{bucket}/{key}", filesystem=self._fs)
|
|
334
334
|
return dataset.read(use_threads=True)
|
|
335
335
|
except Exception as e:
|
|
336
|
-
_logger.exception("Failed to read
|
|
336
|
+
_logger.exception(f"Failed to read {bucket}/{key}.")
|
|
337
337
|
raise OperationalError(*e.args) from e
|
|
338
338
|
|
|
339
339
|
def _as_arrow(self) -> Table:
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
import fsspec
|
|
4
|
+
|
|
5
|
+
from pyathena.filesystem.s3 import S3FileSystem
|
|
6
|
+
|
|
7
|
+
_logger = logging.getLogger(__name__)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def register_s3_filesystem() -> None:
|
|
11
|
+
"""Register PyAthena's S3 filesystem as fsspec's "s3" / "s3a" protocols.
|
|
12
|
+
|
|
13
|
+
PyAthena registers its own filesystem so that the pandas/polars result
|
|
14
|
+
sets can read query results from S3 without depending on s3fs. The
|
|
15
|
+
registration replaces fsspec's default lazy mapping of the "s3" protocol
|
|
16
|
+
to s3fs, which means ``fsspec.filesystem("s3")`` returns PyAthena's
|
|
17
|
+
implementation and s3fs-specific settings (e.g., the ``S3FS_LOGGING_LEVEL``
|
|
18
|
+
environment variable) have no effect.
|
|
19
|
+
|
|
20
|
+
A filesystem class that has already been registered explicitly is also
|
|
21
|
+
overwritten, with a warning log. To restore another implementation,
|
|
22
|
+
re-register it after importing ``pyathena.pandas`` / ``pyathena.polars``::
|
|
23
|
+
|
|
24
|
+
fsspec.register_implementation("s3", s3fs.S3FileSystem, clobber=True)
|
|
25
|
+
"""
|
|
26
|
+
for protocol in ("s3", "s3a"):
|
|
27
|
+
registered = fsspec.registry.get(protocol)
|
|
28
|
+
if registered is not None and registered is not S3FileSystem:
|
|
29
|
+
_logger.warning(
|
|
30
|
+
f"The fsspec {protocol!r} protocol is already registered as "
|
|
31
|
+
f"{registered.__module__}.{registered.__qualname__} and will be overwritten by "
|
|
32
|
+
f"{S3FileSystem.__module__}.{S3FileSystem.__qualname__}."
|
|
33
|
+
)
|
|
34
|
+
_logger.debug(f"Registering {S3FileSystem} as the fsspec {protocol!r} protocol.")
|
|
35
|
+
fsspec.register_implementation(protocol, S3FileSystem, clobber=True)
|