Skip to content

Commit

Permalink
[MINOR][PYTHON] Remove deprecated use of typing.io
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?
Use `typing.BinaryIO` instead of `typing.io.BinaryIO`. The latter is deprecated and had questionable type checker support, see python/cpython#92871

### Why are the changes needed?
So Spark is unaffected when `typing.io` is removed in Python 3.13

### Does this PR introduce any user-facing change?
No

### How was this patch tested?
Existing unit tests / every import of this module

Closes apache#41084 from hauntsaninja/patch-1.

Authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
  • Loading branch information
hauntsaninja authored and LuciferYang committed May 10, 2023
1 parent f6e31e4 commit ff6ee19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/pyspark/broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from typing import (
overload,
Any,
BinaryIO,
Callable,
Dict,
Generic,
Expand All @@ -35,7 +36,6 @@
TYPE_CHECKING,
Union,
)
from typing.io import BinaryIO # type: ignore[import]

from pyspark.java_gateway import local_connect_and_auth
from pyspark.serializers import ChunkedStream, pickle_protocol
Expand Down

0 comments on commit ff6ee19

Please sign in to comment.