Skip to content

Commit

Permalink
Disable pyiceberg imports when Python < 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-eric committed Jul 13, 2023
1 parent 4a2359c commit b4ca73f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 6 additions & 4 deletions metadata-ingestion/tests/integration/iceberg/test_iceberg.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
validate_all_providers_have_committed_successfully,
)

pytestmark = pytest.mark.skipif(
sys.version_info < (3, 8), reason="requires python 3.8 or higher"
)

FROZEN_TIME = "2020-04-14 07:00:00"
GMS_PORT = 8080
GMS_SERVER = f"http://localhost:{GMS_PORT}"


@pytest.fixture(autouse=True)
def skip_tests_if_python_before_3_8():
if sys.version_info < (3, 8):
pytest.skip("Requires python 3.8 or higher")


def spark_submit(file_path: str, args: str = "") -> None:
docker = "docker"
command = f"{docker} exec spark-iceberg spark-submit {file_path} {args}"
Expand Down
8 changes: 5 additions & 3 deletions metadata-ingestion/tests/unit/test_iceberg.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@
TimeTypeClass,
)

pytestmark = pytest.mark.skipif(
sys.version_info < (3, 8), reason="requires python 3.8 or higher"
)

@pytest.fixture(autouse=True)
def skip_tests_if_python_before_3_8():
if sys.version_info < (3, 8):
pytest.skip("Requires python 3.8 or higher")


def with_iceberg_source() -> IcebergSource:
Expand Down

0 comments on commit b4ca73f

Please sign in to comment.