HyukjinKwon commented on a change in pull request #29121:
URL: https://github.com/apache/spark/pull/29121#discussion_r461360724
##########
File path: python/pyspark/ml/tests/test_stat.py
##########
@@ -40,7 +40,7 @@ def test_chisquaretest(self):
if __name__ == "__main__":
- from pyspark.ml.tests.test_stat import *
+ from pyspark.ml.tests.test_stat import * # noqa: F401
Review comment:
Ah, these imports actually makes the output file paths correct. For
example, if you run the unittests, the console outputs are like:
```
test_blahblah (pyspark.sql.blahblah.BlahBlahTests) ... ok
----------------------------------------------------------------------
Ran 3 tests in 0.001s
OK
```
if you remove the imports, the output becomes:
```
test_blahblah (__main__.BlahBlahTests) ... ok
----------------------------------------------------------------------
Ran 3 tests in 0.001s
OK
```
It's related to who we run the tests via our custom script
`python/run-tests.py`. Let's leave them as are for now.
##########
File path: python/pyspark/ml/tests/test_wrapper.py
##########
@@ -116,9 +116,8 @@ def test_new_java_array(self):
java_array = JavaWrapper._new_java_array(str_list, java_class)
self.assertEqual(_java2py(self.sc, java_array), expected_str_list)
-if __name__ == "__main__":
- from pyspark.ml.tests.test_wrapper import *
Review comment:
So .. let's don't remove this.
##########
File path: python/pyspark/ml/tests/test_stat.py
##########
@@ -40,7 +40,7 @@ def test_chisquaretest(self):
if __name__ == "__main__":
- from pyspark.ml.tests.test_stat import *
+ from pyspark.ml.tests.test_stat import * # noqa: F401
Review comment:
Ah, these imports actually make the output file paths correct. For
example, if you run the unittests, the console outputs are like:
```
test_blahblah (pyspark.sql.blahblah.BlahBlahTests) ... ok
----------------------------------------------------------------------
Ran 3 tests in 0.001s
OK
```
if you remove the imports, the output becomes:
```
test_blahblah (__main__.BlahBlahTests) ... ok
----------------------------------------------------------------------
Ran 3 tests in 0.001s
OK
```
It's related to how we run the tests via our custom script
`python/run-tests.py`. Let's leave them as are for now.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]