Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ Extra packages:
+---------------+---------------------------------------+------------------+
| Arrow | ``pip install PyAthena[Arrow]`` | >=10.0.0 |
+---------------+---------------------------------------+------------------+
| fastparquet | ``pip install PyAthena[fastparquet]`` | >=0.4.0 |
+---------------+---------------------------------------+------------------+

.. _usage:

Expand Down
2 changes: 0 additions & 2 deletions docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ Extra packages:
+---------------+---------------------------------------+------------------+
| Arrow | ``pip install PyAthena[Arrow]`` | >=7.0.0 |
+---------------+---------------------------------------+------------------+
| fastparquet | ``pip install PyAthena[fastparquet]`` | >=0.4.0 |
+---------------+---------------------------------------+------------------+

.. _features:

Expand Down
1 change: 0 additions & 1 deletion pyathena/fastparquet/__init__.py

This file was deleted.

65 changes: 0 additions & 65 deletions pyathena/fastparquet/util.py

This file was deleted.

28 changes: 5 additions & 23 deletions pyathena/pandas/result_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,13 @@ def _get_parquet_engine(self) -> str:
"""Get the parquet engine to use, handling auto-detection.

Returns:
Name of the parquet engine to use ('pyarrow' or 'fastparquet').
Name of the parquet engine to use ('pyarrow').

Raises:
ImportError: If no suitable parquet engine is available.
ImportError: If pyarrow is not available.
"""
if self._engine == "auto":
return self._get_available_engine(["pyarrow", "fastparquet"])
return self._get_available_engine(["pyarrow"])
return self._engine

def _get_csv_engine(
Expand Down Expand Up @@ -554,11 +554,8 @@ def _read_parquet(self, engine) -> "DataFrame":
kwargs = {
"use_threads": True,
}
elif engine == "fastparquet":
unload_location = f"{self._unload_location}*"
kwargs = {}
else:
raise ProgrammingError("Engine must be one of `pyarrow`, `fastparquet`.")
raise ProgrammingError("Engine must be `pyarrow`.")
kwargs.update(self._kwargs)

try:
Expand Down Expand Up @@ -592,23 +589,8 @@ def _read_parquet_schema(self, engine) -> Tuple[Dict[str, Any], ...]:
except Exception as e:
_logger.exception(f"Failed to read schema {bucket}/{key}.")
raise OperationalError(*e.args) from e
elif engine == "fastparquet":
from fastparquet import ParquetFile

# TODO: https://github.com/python/mypy/issues/1153
from pyathena.fastparquet.util import to_column_info # type: ignore

if not self._data_manifest:
self._data_manifest = self._read_data_manifest()
bucket, key = parse_output_location(self._data_manifest[0])
try:
file = ParquetFile(f"{bucket}/{key}", open_with=self._fs.open)
return to_column_info(file.schema)
except Exception as e:
_logger.exception(f"Failed to read schema {bucket}/{key}.")
raise OperationalError(*e.args) from e
else:
raise ProgrammingError("Engine must be one of `pyarrow`, `fastparquet`.")
raise ProgrammingError("Engine must be `pyarrow`.")

def _as_pandas(self) -> Union["TextFileReader", "DataFrame"]:
if self.is_unload:
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,13 @@ awsathena = "pyathena.sqlalchemy.base:AthenaDialect"
sqlalchemy = ["sqlalchemy>=1.0.0"]
pandas = ["pandas>=1.3.0"]
arrow = ["pyarrow>=10.0.0"]
fastparquet = ["fastparquet>=0.4.0"]

[dependency-groups]
dev = [
"sqlalchemy>=1.0.0",
"pandas>=1.3.0",
"numpy>=1.26.0",
"pyarrow>=10.0.0",
"fastparquet>=0.4.0",
"Jinja2>=3.1.0",
"mypy>=0.900",
"pytest>=3.5",
Expand Down
1 change: 0 additions & 1 deletion tests/pyathena/fastparquet/__init__.py

This file was deleted.

Loading