Skip to content

Commit

Permalink
[SPARK-32435][PYTHON] Remove heapq3 port from Python 3
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

This PR removes the manual port of `heapq3.py` introduced from SPARK-3073. The main reason of this was to support Python 2.6 and 2.7 because Python 2's `heapq.merge()` doesn't not support `key` and `reverse`.

See
- https://docs.python.org/2/library/heapq.html#heapq.merge in Python 2
- https://docs.python.org/3.8/library/heapq.html#heapq.merge in Python 3

Since we dropped the Python 2 at SPARK-32138, we can remove this away.

### Why are the changes needed?

To remove unnecessary codes. Also, we can leverage bug fixes made in Python 3.x at `heapq`.

### Does this PR introduce _any_ user-facing change?

No, dev-only.

### How was this patch tested?

Existing tests should cover. I locally ran and verified:

```bash
./python/run-tests --python-executable=python3 --testname="pyspark.tests.test_shuffle"
./python/run-tests --python-executable=python3 --testname="pyspark.shuffle ExternalSorter"
./python/run-tests --python-executable=python3 --testname="pyspark.tests.test_rdd RDDTests.test_external_group_by_key"
```

Closes apache#29229 from HyukjinKwon/SPARK-32435.

Authored-by: HyukjinKwon <[email protected]>
Signed-off-by: HyukjinKwon <[email protected]>
  • Loading branch information
HyukjinKwon committed Jul 27, 2020
1 parent 6ab29b3 commit a82aee0
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 1,232 deletions.
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ external/spark-ganglia-lgpl/src/main/java/com/codahale/metrics/ganglia/GangliaRe
Python Software Foundation License
----------------------------------

pyspark/heapq3.py
python/docs/source/_static/copybutton.js

BSD 3-Clause
Expand Down
6 changes: 0 additions & 6 deletions LICENSE-binary
Original file line number Diff line number Diff line change
Expand Up @@ -557,12 +557,6 @@ jakarta.ws.rs:jakarta.ws.rs-api https://github.com/eclipse-ee4j/jaxrs-api
org.glassfish.hk2.external:jakarta.inject


Python Software Foundation License
----------------------------------

pyspark/heapq3.py


Public Domain
-------------

Expand Down
1 change: 0 additions & 1 deletion dev/.rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ jsonFormatter.min.js
.*log
pyspark-coverage-site/*
cloudpickle/*
heapq3.py
join.py
SparkExprTyper.scala
SparkILoop.scala
Expand Down
2 changes: 1 addition & 1 deletion dev/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
[pycodestyle]
ignore=E226,E241,E305,E402,E722,E731,E741,W503,W504
max-line-length=100
exclude=python/pyspark/cloudpickle/*.py,heapq3.py,shared.py,python/docs/source/conf.py,work/*/*.py,python/.eggs/*,dist/*,.git/*
exclude=python/pyspark/cloudpickle/*.py,shared.py,python/docs/source/conf.py,work/*/*.py,python/.eggs/*,dist/*,.git/*
280 changes: 0 additions & 280 deletions licenses-binary/LICENSE-heapq.txt

This file was deleted.

49 changes: 0 additions & 49 deletions licenses/LICENSE-heapq.txt

This file was deleted.

2 changes: 1 addition & 1 deletion python/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ profile=no

# Add files or directories to the ignoreList. They should be base names, not
# paths.
ignore=pyspark.heapq3
#ignore=

# Pickle collected data for later comparisons.
persistent=yes
Expand Down
Loading

0 comments on commit a82aee0

Please sign in to comment.