Skip to content

Commit b124e53

Browse files
committed
test(spark): handle remote skipping when asserting facts about local files
1 parent 65c957b commit b124e53

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

ibis/backends/pyspark/tests/test_import_export.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from pandas.testing import assert_frame_equal
99

1010
from ibis.backends.pyspark.datatypes import PySparkSchema
11+
from ibis.conftest import IS_SPARK_REMOTE
1112

1213

1314
@pytest.mark.parametrize(
@@ -76,6 +77,9 @@ def test_to_parquet_dir(con_streaming, tmp_path):
7677
assert len(df) == 5
7778

7879

80+
@pytest.mark.skipif(
81+
IS_SPARK_REMOTE, reason="Spark remote does not support assertions about local paths"
82+
)
7983
def test_to_parquet_read_parquet(con, tmp_path):
8084
# No Partitions
8185
t_out = con.table("awards_players")

ibis/backends/tests/test_export.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ def test_to_pyarrow_batches_memtable(con):
207207

208208

209209
def test_table_to_parquet(tmp_path, backend, awards_players):
210+
if backend.name() == "pyspark" and IS_SPARK_REMOTE:
211+
pytest.skip("writes to remote output directory")
210212
outparquet = tmp_path / "out.parquet"
211213
awards_players.to_parquet(outparquet)
212214

@@ -258,6 +260,8 @@ def test_table_to_parquet_writer_kwargs(version, tmp_path, backend, awards_playe
258260
awards_players.to_parquet(outparquet, version=version)
259261

260262
if backend.name() == "pyspark":
263+
if IS_SPARK_REMOTE:
264+
pytest.skip("writes to remote output directory")
261265
# Pyspark will write more than one parquet file under outparquet as directory
262266
parquet_files = sorted(outparquet.glob("*.parquet"))
263267
df = (
@@ -349,6 +353,8 @@ def test_memtable_to_file(tmp_path, con, ftype, monkeypatch):
349353
getattr(con, f"to_{ftype}")(memtable, outfile)
350354

351355
if con.name == "pyspark" and ftype == "parquet":
356+
if IS_SPARK_REMOTE:
357+
pytest.skip("writes to remote output directory")
352358
assert outfile.is_dir()
353359
else:
354360
assert outfile.is_file()

0 commit comments

Comments
 (0)