Skip to content

Commit

Permalink
chore(pyspark): fix ParseException import on older pyspark
Browse files Browse the repository at this point in the history
  • Loading branch information
gforsyth committed Jul 18, 2024
1 parent bd2a99a commit 30020cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ibis/backends/pyspark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import sqlglot.expressions as sge
from packaging.version import parse as vparse
from pyspark import SparkConf
from pyspark.errors import ParseException as PySparkParseException
from pyspark.sql import SparkSession
from pyspark.sql.types import BooleanType, DoubleType, LongType, StringType

Expand All @@ -30,6 +29,11 @@
from ibis.legacy.udf.vectorized import _coerce_to_series
from ibis.util import deprecated

try:
from pyspark.errors import ParseException as PySparkParseException
except ImportError:
from pyspark.sql.utils import ParseException as PySparkParseException

if TYPE_CHECKING:
from collections.abc import Mapping, Sequence
from urllib.parse import ParseResult
Expand Down

0 comments on commit 30020cd

Please sign in to comment.