Skip to content

Commit

Permalink
add pytest guards
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 committed Nov 3, 2022
1 parent a82e5cb commit 68c02b4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions metadata-ingestion/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
from typing import Dict, Set

import setuptools
Expand Down Expand Up @@ -398,7 +399,7 @@ def get_long_description():
"delta-lake",
"druid",
"elasticsearch",
"feast",
"feast" if sys.version_info >= (3, 8) else None,
"iceberg",
"ldap",
"looker",
Expand Down Expand Up @@ -426,6 +427,7 @@ def get_long_description():
"unity-catalog"
# airflow is added below
]
if plugin
for dependency in plugins[plugin]
),
}
Expand All @@ -445,7 +447,6 @@ def get_long_description():
"clickhouse",
"delta-lake",
"druid",
"feast",
"feast-legacy",
"hana",
"hive",
Expand Down
5 changes: 5 additions & 0 deletions metadata-ingestion/src/datahub/ingestion/source/feast.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import sys

if sys.version_info < (3, 8):
raise ImportError("Feast is only supported on Python 3.8+")

from dataclasses import dataclass
from typing import Dict, Iterable, List, Optional, Tuple, Union

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os
import sys

import pytest
from freezegun import freeze_time
Expand All @@ -8,11 +8,12 @@

FROZEN_TIME = "2020-04-14 07:00:00"

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


@freeze_time(FROZEN_TIME)
@pytest.mark.skipif(
os.getenv("AIRFLOW1_TEST") == "true", reason="feast requires Airflow 2.0 or newer"
)
def test_feast_repository_ingest(pytestconfig, tmp_path, mock_time):
test_resources_dir = pytestconfig.rootpath / "tests/integration/feast"
output_path = tmp_path / "feast_repository_mces.json"
Expand Down

0 comments on commit 68c02b4

Please sign in to comment.