diff --git a/kedro-datasets/tests/snowflake/test_snowpark_dataset.py b/kedro-datasets/tests/snowflake/test_snowpark_dataset.py index 3758b6efc..f9cc976a2 100644 --- a/kedro-datasets/tests/snowflake/test_snowpark_dataset.py +++ b/kedro-datasets/tests/snowflake/test_snowpark_dataset.py @@ -3,18 +3,23 @@ import pandas as pd import pytest -from snowflake.snowpark import DataFrame -from snowflake.snowpark.session import Session -from snowflake.snowpark.types import ( - DateType, - FloatType, - IntegerType, - StringType, - StructField, - StructType, - TimestampType, -) +# needed for pytest to skip tests for python versions >= 3.12 +try: + from snowflake.snowpark import DataFrame, Session + from snowflake.snowpark.types import ( + DateType, + FloatType, + IntegerType, + StringType, + StructField, + StructType, + TimestampType, + ) + + SNOWPARK_AVAILABLE = True +except ImportError: + SNOWPARK_AVAILABLE = False from kedro_datasets.snowflake.snowpark_dataset import SnowparkTableDataset # Example dummy configuration for testing