Skip to content

Commit

Permalink
fix error on machines with pyspark installed where passed dataframe i…
Browse files Browse the repository at this point in the history
…s not spark pandas (#1415)
  • Loading branch information
imatiach-msft authored May 11, 2022
1 parent 0dfa112 commit d0047f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions erroranalysis/erroranalysis/_internal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np

try:
import pyspark
import pyspark.pandas as ps
spark_available = True
except ImportError:
spark_available = False
Expand Down Expand Up @@ -47,4 +47,7 @@ def is_spark(df):
:return: True if the dataframe is a spark dataframe, False otherwise.
:rtype: bool
"""
return spark_available and isinstance(df, pyspark.pandas.frame.DataFrame)
try:
return spark_available and isinstance(df, ps.frame.DataFrame)
except Exception:
return False
2 changes: 1 addition & 1 deletion erroranalysis/erroranalysis/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
name = 'erroranalysis'
_major = '0'
_minor = '3'
_patch = '0'
_patch = '1'
version = '{}.{}.{}'.format(_major, _minor, _patch)

0 comments on commit d0047f1

Please sign in to comment.