Skip to content

Commit

Permalink
skip trino and impala
Browse files Browse the repository at this point in the history
  • Loading branch information
jitingxu1 committed Sep 20, 2024
1 parent 8b6b3c6 commit 4692e6c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ibis/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,11 +1272,16 @@ def has_operation(cls, operation: type[ops.Value]) -> bool:
f"{cls.name} backend has not implemented `has_operation` API"
)

@util.experimental
def read_parquet(
self, path: str | Path, table_name: str | None = None, **kwargs: Any
) -> ir.Table:
"""Register a parquet file as a table in the current backend.
This function reads a Parquet file and registers it as a table in the current
backend. Note that for Impala and Trino backends, the performance
may be suboptimal.
Parameters
----------
path
Expand Down
6 changes: 6 additions & 0 deletions ibis/backends/tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,12 @@ def test_register_garbage(con, monkeypatch):
def test_read_parquet(con, tmp_path, data_dir, fname, in_table_name):
pq = pytest.importorskip("pyarrow.parquet")

if con.name in ("trino", "impala"):
# TODO: remove after trino and impala have efficient insertion
pytest.skip(
"Both Impala and Trino lack efficient data insertion methods from Python."
)

fname = Path(fname)
fname = Path(data_dir) / "parquet" / fname.name
table = pq.read_table(fname)
Expand Down

0 comments on commit 4692e6c

Please sign in to comment.