LuciferYang opened a new pull request, #56279: URL: https://github.com/apache/spark/pull/56279
### What changes were proposed in this pull request? This fixes the mypy failures that appear once the unpinned `pandas-stubs>=2.2.0` resolves to a recent release (currently 3.0.3.260530). The newer stubs tighten `Series.astype` into strict overloads, so the dynamically-typed `dtype` arguments passed to `astype` in `pyspark.sql.pandas.types` no longer match any overload and are silenced with `# type: ignore[call-overload]`. The stubs also add `PandasObject` to `pandas.core.base`, which makes the existing `# type: ignore[attr-defined]` in `pyspark.pandas.plot.core` unused, so it is removed. `Index.droplevel` is now typed as taking `Sequence[Never]` in `pyspark.pandas.frame`, and `assert_frame_equal` no longer lists the still-supported `check_datetimelike_compat` keyword in `pyspark.pandas.testing`; both are stub inaccuracies and are silenced with the matching ignore code. ### Why are the changes needed? `pandas-stubs` is unpinned (`>=2.2.0`) and is not a runtime dependency, so the lint image picks up the latest release when rebuilt and breaks the mypy check on master. This restores a green lint without pinning the stubs, consistent with how similar stub drift has been handled before (for example SPARK-55108 and SPARK-56765). ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Ran `dev/lint-python --mypy` against `pandas-stubs==3.0.3.260530` (the version the CI image currently resolves) and confirmed the previously-failing checks pass. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 4.8 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
