sarutak opened a new pull request, #57173: URL: https://github.com/apache/spark/pull/57173
### What changes were proposed in this pull request? This PR adds `np is not None` guard before `isinstance(v, np.generic)` in `_normalize_state_value` to fix a mypy `union-attr` error. ### Why are the changes needed? To recover CI. https://github.com/apache/spark/actions/runs/29053540012/job/86240085317 ``` annotations failed mypy checks: Error: python/pyspark/sql/streaming/stateful_processor_api_client.py:64: error: Item "None" of Module | None has no attribute "generic" [union-attr] python/pyspark/worker.py:2114: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked] Found 1 error in 1 file (checked 1243 source files) ``` ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? - `python3 -m mypy --config-file python/mypy.ini python/pyspark/sql/streaming/stateful_processor_api_client.py` passes. - `pyspark.tests.test_import_spark.ImportSparkTest.test_import_spark_libraries` still passes. ### Was this patch authored or co-authored using generative AI tooling? Kiro CLI / Claude -- 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]
