Skip to content

Commit

Permalink
[SPARK-23319][TESTS][FOLLOWUP] Fix a test for Python 3 without pandas.
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?

This is a followup pr of #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 #20538 from ueshin/issues/SPARK-23319/fup1.
  • Loading branch information
ueshin authored and HyukjinKwon committed Feb 8, 2018
1 parent 30295bf commit a62f30d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/pyspark/sql/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2860,7 +2860,7 @@ def test_create_dataframe_required_pandas_not_found(self):
with QuietTest(self.sc):
with self.assertRaisesRegexp(
ImportError,
'(Pandas >= .* must be installed|No module named pandas)'):
"(Pandas >= .* must be installed|No module named '?pandas'?)"):
import pandas as pd
from datetime import datetime
pdf = pd.DataFrame({"ts": [datetime(2017, 10, 31, 1, 1, 1)],
Expand Down

0 comments on commit a62f30d

Please sign in to comment.