Skip to content

Commit

Permalink
try except block for snowpark imports
Browse files Browse the repository at this point in the history
Signed-off-by: tdhooghe <[email protected]>
  • Loading branch information
tdhooghe committed Oct 22, 2024
1 parent db5554e commit 6230dfb
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions kedro-datasets/tests/snowflake/test_snowpark_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6230dfb

Please sign in to comment.