Skip to content

Conversation

@laserson
Copy link
Contributor

The PySpark tests depend on unittest.skipIf, which was only added in Python 2.7. This should remedy the build failures on Python 2.6. The only remaining piece is that it may be necessary to install unittest2 with Python 2.6, if it's not provided automatically.

The PySpark tests depend on `unittest.skipIf`, which was only added in Python 2.7.  This should remedy the build failures on Python 2.6.  The only remaining piece is that it may be necessary to install `unittest2` with Python 2.6, if it's not provided automatically.
@laserson
Copy link
Contributor Author

This may require modifying the Jenkins config to make sure unittest2 is available, if it's not by default.

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@JoshRosen
Copy link
Contributor

Jenkins, add to whitelist and test this please.

@SparkQA
Copy link

SparkQA commented Jul 25, 2014

QA tests have started for PR 1042. This patch merges cleanly.
View progress: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/17146/consoleFull

@SparkQA
Copy link

SparkQA commented Jul 25, 2014

QA results for PR 1042:
- This patch PASSES unit tests.
- This patch merges cleanly
- This patch adds no public classes

For more information see test ouptut:
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/17146/consoleFull

@JoshRosen
Copy link
Contributor

It looks like unittest2 isn't the only change required for the unit tests to pass on Python 2.6.

In tests.py, createFileInZip() uses ZipFile as a context manager, which is only supported in Python 2.7+ (https://docs.python.org/2.7/library/zipfile.html?highlight=zipfile#zipfile.ZipFile):

        with zipfile.ZipFile(path, 'w') as zip:
            zip.writestr(name, content)
        return path

We should probably replace this with a try-finally block.

There's a neat tool called pyqver that aims to identify the minimum required Python version for a particular script. Unfortunately, it doesn't detect this ZipFile issue; I'll look into opening a pull request to add a check for it.

@JoshRosen
Copy link
Contributor

Actually, scratch that: pyqver won't be able to check whether usage of an object as a context manager is supported because it won't be able to statically determine the type of the object.

JoshRosen added a commit to JoshRosen/spark that referenced this pull request Aug 10, 2014
- Modify python/run-tests to test with Python 2.6, if available.
- Use unittest2 when running on Python 2.6.
- Fix issue with namedtuple.
- Skip TestOutputFormat.test_newhadoop on Python 2.6 until SPARK-2951 is fixed.

Closes apache#1868.  Closes apache#1042.
@asfgit asfgit closed this in db06a81 Aug 11, 2014
asfgit pushed a commit that referenced this pull request Aug 11, 2014
…2.6 Fixes

- Modify python/run-tests to test with Python 2.6
- Use unittest2 when running on Python 2.6.
- Fix issue with namedtuple.
- Skip TestOutputFormat.test_newhadoop on Python 2.6 until SPARK-2951 is fixed.
- Fix MLlib _deserialize_double on Python 2.6.

Closes #1868.  Closes #1042.

Author: Josh Rosen <[email protected]>

Closes #1874 from JoshRosen/python2.6 and squashes the following commits:

983d259 [Josh Rosen] [SPARK-2954] Fix MLlib _deserialize_double on Python 2.6.
5d18fd7 [Josh Rosen] [SPARK-2948] [SPARK-2910] [SPARK-2101] Python 2.6 fixes

(cherry picked from commit db06a81)
Signed-off-by: Josh Rosen <[email protected]>
xiliu82 pushed a commit to xiliu82/spark that referenced this pull request Sep 4, 2014
…2.6 Fixes

- Modify python/run-tests to test with Python 2.6
- Use unittest2 when running on Python 2.6.
- Fix issue with namedtuple.
- Skip TestOutputFormat.test_newhadoop on Python 2.6 until SPARK-2951 is fixed.
- Fix MLlib _deserialize_double on Python 2.6.

Closes apache#1868.  Closes apache#1042.

Author: Josh Rosen <[email protected]>

Closes apache#1874 from JoshRosen/python2.6 and squashes the following commits:

983d259 [Josh Rosen] [SPARK-2954] Fix MLlib _deserialize_double on Python 2.6.
5d18fd7 [Josh Rosen] [SPARK-2948] [SPARK-2910] [SPARK-2101] Python 2.6 fixes
davies pushed a commit to davies/spark that referenced this pull request Dec 10, 2014
…2.6 Fixes

- Modify python/run-tests to test with Python 2.6
- Use unittest2 when running on Python 2.6.
- Fix issue with namedtuple.
- Skip TestOutputFormat.test_newhadoop on Python 2.6 until SPARK-2951 is fixed.
- Fix MLlib _deserialize_double on Python 2.6.

Closes apache#1868.  Closes apache#1042.

Author: Josh Rosen <[email protected]>

Closes apache#1874 from JoshRosen/python2.6 and squashes the following commits:

983d259 [Josh Rosen] [SPARK-2954] Fix MLlib _deserialize_double on Python 2.6.
5d18fd7 [Josh Rosen] [SPARK-2948] [SPARK-2910] [SPARK-2101] Python 2.6 fixes

Conflicts:
	python/pyspark/mllib/_common.py
	python/pyspark/serializers.py
	python/pyspark/tests.py
flyrain pushed a commit to flyrain/spark that referenced this pull request Sep 21, 2021
wangyum pushed a commit that referenced this pull request May 26, 2023
* [CARMEL-6113] Support BHJ fallback to SMJ in AQE

* fix code style

* Add log if FallbackBroadcastStage takes effect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants