Skip to content

Commit

Permalink
Tests: Make Spark optional for testing (apache#568)
Browse files Browse the repository at this point in the history
For the release, we check the Avro decoder, but we don't
want to install PySpark all the time.
  • Loading branch information
Fokko authored Apr 1, 2024
1 parent 1cdd63f commit 5ef9f3d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import boto3
import pytest
from moto import mock_aws
from pyspark.sql import SparkSession

from pyiceberg import schema
from pyiceberg.catalog import Catalog, load_catalog
Expand Down Expand Up @@ -86,6 +85,7 @@
if TYPE_CHECKING:
import pyarrow as pa
from moto.server import ThreadedMotoServer # type: ignore
from pyspark.sql import SparkSession

from pyiceberg.io.pyarrow import PyArrowFileIO

Expand Down Expand Up @@ -1954,9 +1954,10 @@ def session_catalog() -> Catalog:


@pytest.fixture(scope="session")
def spark() -> SparkSession:
def spark() -> "SparkSession":
import importlib.metadata
import os

from pyspark.sql import SparkSession

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

0 comments on commit 5ef9f3d

Please sign in to comment.