[SPARK-9942] [PYSPARK] [SQL] ignore exceptions while try to import pandas

If pandas is broken (can't be imported, raise other exceptions other than ImportError), pyspark can't be imported, we should ignore all the exceptions.

Author: Davies Liu <davies@databricks.com>

Closes #8173 from davies/fix_pandas.
This commit is contained in:
Davies Liu 2015-08-13 14:03:55 -07:00 committed by Reynold Xin
parent 864de8eaf4
commit a8d2f4c5f9

View file

@ -39,7 +39,7 @@ from pyspark.sql.functions import UserDefinedFunction
try: try:
import pandas import pandas
has_pandas = True has_pandas = True
except ImportError: except Exception:
has_pandas = False has_pandas = False
__all__ = ["SQLContext", "HiveContext", "UDFRegistration"] __all__ = ["SQLContext", "HiveContext", "UDFRegistration"]