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 0d55190
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ibis/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import re
import sys
import urllib.parse
import urllib.request
import weakref
from io import BytesIO
from pathlib import Path
Expand Down Expand Up @@ -1272,11 +1271,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
12 changes: 12 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 Expand Up @@ -466,6 +472,12 @@ def test_read_parquet_url_request(con, url, data_dir, in_table_name, monkeypatch
pytest.importorskip("pyarrow.parquet")
fsspec = pytest.importorskip("fsspec")

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("functional_alltypes.parquet")
fname = Path(data_dir) / "parquet" / fname.name
mock_calls = []
Expand Down

0 comments on commit 0d55190

Please sign in to comment.