You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2018/02/08 03:46:15 UTC

spark git commit: [SPARK-23319][TESTS][FOLLOWUP] Fix a test for Python 3 without pandas.

Repository: spark
Updated Branches:
  refs/heads/master 30295bf5a -> a62f30d3f


[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 #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 <ue...@databricks.com>

Closes #20538 from ueshin/issues/SPARK-23319/fup1.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/a62f30d3
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/a62f30d3
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/a62f30d3

Branch: refs/heads/master
Commit: a62f30d3fa032ff75bc2b7bebbd0813e67ea5fd5
Parents: 30295bf
Author: Takuya UESHIN <ue...@databricks.com>
Authored: Thu Feb 8 12:46:10 2018 +0900
Committer: hyukjinkwon <gu...@gmail.com>
Committed: Thu Feb 8 12:46:10 2018 +0900

----------------------------------------------------------------------
 python/pyspark/sql/tests.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/a62f30d3/python/pyspark/sql/tests.py
----------------------------------------------------------------------
diff --git a/python/pyspark/sql/tests.py b/python/pyspark/sql/tests.py
index 58359b6..90ff084 100644
--- a/python/pyspark/sql/tests.py
+++ b/python/pyspark/sql/tests.py
@@ -2860,7 +2860,7 @@ class SQLTests(ReusedSQLTestCase):
         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)],


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org