From ff6ee19ebfea0ac94b64eef22722ca964df664c0 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Mon, 8 May 2023 10:47:00 +0900 Subject: [PATCH] [MINOR][PYTHON] Remove deprecated use of typing.io ### 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 https://github.com/python/cpython/issues/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 #41084 from hauntsaninja/patch-1. Authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Signed-off-by: Hyukjin Kwon --- python/pyspark/broadcast.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyspark/broadcast.py b/python/pyspark/broadcast.py index a72bf1e059bfe..605663a220494 100644 --- a/python/pyspark/broadcast.py +++ b/python/pyspark/broadcast.py @@ -24,6 +24,7 @@ from typing import ( overload, Any, + BinaryIO, Callable, Dict, Generic, @@ -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