Skip to content

Commit 461fe1e

Browse files
ueshinRobert Kruszewski
authored andcommitted
[SPARK-23319][TESTS][FOLLOWUP] Fix a test for Python 3 without pandas.
## What changes were proposed in this pull request? This is a followup pr of apache#20487. When importing module but it doesn't exists, the error message is slightly different between Python 2 and 3. E.g., in Python 2: ``` No module named pandas ``` in Python 3: ``` No module named 'pandas' ``` So, one test to check an import error fails in Python 3 without pandas. This pr fixes it. ## How was this patch tested? Tested manually in my local environment. Author: Takuya UESHIN <[email protected]> Closes apache#20538 from ueshin/issues/SPARK-23319/fup1.
1 parent b3e1cf8 commit 461fe1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/pyspark/sql/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2860,7 +2860,7 @@ def test_create_dataframe_required_pandas_not_found(self):
28602860
with QuietTest(self.sc):
28612861
with self.assertRaisesRegexp(
28622862
ImportError,
2863-
'(Pandas >= .* must be installed|No module named pandas)'):
2863+
"(Pandas >= .* must be installed|No module named '?pandas'?)"):
28642864
import pandas as pd
28652865
from datetime import datetime
28662866
pdf = pd.DataFrame({"ts": [datetime(2017, 10, 31, 1, 1, 1)],

0 commit comments

Comments
 (0)