Skip to content

Commit

Permalink
Tests: Make Spark optional for testing
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 committed Apr 1, 2024
1 parent 4c1cfdc commit 39bf426
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 39bf426

Please sign in to comment.