From 2362923808007b97a02751fed522438d229a6a8c Mon Sep 17 00:00:00 2001 From: Enrico Minack Date: Thu, 15 Aug 2024 21:39:57 +0200 Subject: [PATCH] Fix detecting connect availability --- python/gresearch/spark/__init__.py | 2 +- python/gresearch/spark/diff/__init__.py | 2 +- python/gresearch/spark/parquet/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/gresearch/spark/__init__.py b/python/gresearch/spark/__init__.py index 75eeb996..6ff299c5 100644 --- a/python/gresearch/spark/__init__.py +++ b/python/gresearch/spark/__init__.py @@ -39,7 +39,7 @@ from pyspark.sql.connect.readwriter import DataFrameReader as ConnectDataFrameReader from pyspark.sql.connect.session import SparkSession as ConnectSparkSession has_connect = True -except ModuleNotFoundError: +except ImportError: has_connect = False if TYPE_CHECKING: diff --git a/python/gresearch/spark/diff/__init__.py b/python/gresearch/spark/diff/__init__.py index f9ca8272..351dc587 100644 --- a/python/gresearch/spark/diff/__init__.py +++ b/python/gresearch/spark/diff/__init__.py @@ -26,7 +26,7 @@ try: from pyspark.sql.connect.dataframe import DataFrame as ConnectDataFrame has_connect = True -except ModuleNotFoundError: +except ImportError: has_connect = False diff --git a/python/gresearch/spark/parquet/__init__.py b/python/gresearch/spark/parquet/__init__.py index 9aaa067b..890f22f0 100644 --- a/python/gresearch/spark/parquet/__init__.py +++ b/python/gresearch/spark/parquet/__init__.py @@ -22,7 +22,7 @@ try: from pyspark.sql.connect.readwriter import DataFrameReader as ConnectDataFrameReader has_connect = True -except ModuleNotFoundError: +except ImportError: has_connect = False