GitHub user HyukjinKwon opened a pull request:

    https://github.com/apache/spark/pull/23077

    [SPARK-25344][PYTHON] Clean unittest2 imports up that were added for Python 
2.6 before

    ## What changes were proposed in this pull request?
    
    Currently, some of PySpark tests sill assume the tests could be ran in 
Python 2.6 by importing `unittest2`. For instance:
    
    ```python
    if sys.version_info[:2] <= (2, 6):
        try:
            import unittest2 as unittest
        except ImportError:
            sys.stderr.write('Please install unittest2 to test with Python 2.6 
or earlier')
            sys.exit(1)
    else:
        import unittest
    ```
    
    While I am here, I removed some of unused imports and reordered imports per 
PEP 8.
    
    We officially dropped Python 2.6 support a while ago and started to discuss 
about Python 2 drop. It's better to remove them out. 
    
    ## How was this patch tested?
    
    Manually tests, and existing tests via Jenkins.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/HyukjinKwon/spark SPARK-26105

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/23077.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #23077
    
----
commit ed834f5062b1d8dff1fe92a6ad678d5d74df2c1c
Author: hyukjinkwon <gurwls223@...>
Date:   2018-11-18T08:17:48Z

    Clean unittest2 imports up added Python 2.6 before

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to