Skip to content

Commit 5ef9f3d

Browse files
authored
Tests: Make Spark optional for testing (#568)
For the release, we check the Avro decoder, but we don't want to install PySpark all the time.
1 parent 1cdd63f commit 5ef9f3d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/conftest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
import boto3
4747
import pytest
4848
from moto import mock_aws
49-
from pyspark.sql import SparkSession
5049

5150
from pyiceberg import schema
5251
from pyiceberg.catalog import Catalog, load_catalog
@@ -86,6 +85,7 @@
8685
if TYPE_CHECKING:
8786
import pyarrow as pa
8887
from moto.server import ThreadedMotoServer # type: ignore
88+
from pyspark.sql import SparkSession
8989

9090
from pyiceberg.io.pyarrow import PyArrowFileIO
9191

@@ -1954,9 +1954,10 @@ def session_catalog() -> Catalog:
19541954

19551955

19561956
@pytest.fixture(scope="session")
1957-
def spark() -> SparkSession:
1957+
def spark() -> "SparkSession":
19581958
import importlib.metadata
1959-
import os
1959+
1960+
from pyspark.sql import SparkSession
19601961

19611962
spark_version = ".".join(importlib.metadata.version("pyspark").split(".")[:2])
19621963
scala_version = "2.12"

0 commit comments

Comments
 (0)