Skip to content

Commit d05b653

Browse files
committed
[SPARK-48710][PYTHON] Fix type checks for NumPy in tests
1 parent 6103cd5 commit d05b653

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

python/pyspark/core/rdd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5377,7 +5377,7 @@ def _test() -> None:
53775377
from pandas.util.version import Version
53785378

53795379
if Version(np.__version__) >= Version("2"):
5380-
np.set_printoptions(legacy="1.25")
5380+
np.set_printoptions(legacy="1.25") # type: ignore[arg-type] # `legacy="1.25"` only available in `nump>=2`
53815381
except TypeError:
53825382
pass
53835383

python/pyspark/pandas/indexes/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2652,7 +2652,7 @@ def _test() -> None:
26522652
if Version(np.__version__) >= Version("2"):
26532653
# Numpy 2.0+ changed its string format,
26542654
# adding type information to numeric scalars.
2655-
np.set_printoptions(legacy="1.25")
2655+
np.set_printoptions(legacy="1.25") # type: ignore[arg-type] # `legacy="1.25"` only available in `nump>=2`
26562656

26572657
globs = pyspark.pandas.indexes.base.__dict__.copy()
26582658
globs["ps"] = pyspark.pandas

python/pyspark/pandas/indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,7 @@ def _test() -> None:
18401840
if Version(np.__version__) >= Version("2"):
18411841
# Numpy 2.0+ changed its string format,
18421842
# adding type information to numeric scalars.
1843-
np.set_printoptions(legacy="1.25")
1843+
np.set_printoptions(legacy="1.25") # type: ignore[arg-type] # `legacy="1.25"` only available in `nump>=2`
18441844

18451845
globs = pyspark.pandas.indexing.__dict__.copy()
18461846
globs["ps"] = pyspark.pandas

python/pyspark/pandas/namespace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3738,7 +3738,7 @@ def _test() -> None:
37383738
if Version(np.__version__) >= Version("2"):
37393739
# Numpy 2.0+ changed its string format,
37403740
# adding type information to numeric scalars.
3741-
np.set_printoptions(legacy="1.25")
3741+
np.set_printoptions(legacy="1.25") # type: ignore[arg-type] # `legacy="1.25"` only available in `nump>=2`
37423742

37433743
globs = pyspark.pandas.namespace.__dict__.copy()
37443744
globs["ps"] = pyspark.pandas

0 commit comments

Comments
 (0)