bearomorphism opened a new pull request, #59398: URL: https://github.com/apache/spark/pull/59398
### What changes were proposed in this pull request? Import the classic and Connect `SparkSession` types under `TYPE_CHECKING` and annotate the listener's session parameter/property with their union. Remove three `name-defined` type ignores and the corresponding `F821` suppressions. ### Why are the changes needed? `SparkSession` was an unresolved annotation. Listeners can receive either session implementation, and the Connect session is not a subclass of the classic session, so both types are needed. ### Does this PR introduce _any_ user-facing change? Static type checkers can now resolve the listener session type. Runtime session-binding behavior is unchanged. ### How was this patch tested? - Mypy passed on `python/pyspark/sql/streaming/listener.py` and the Connect caller, `python/pyspark/sql/connect/streaming/query.py`. - A local runtime probe using session stand-ins verified initial `None`, binding, repeated-binding no-overwrite behavior, and direct setter assignment. - Ruff lint/format checks and `git diff --check` passed. No new tests were added. The full streaming integration suite was not run; runtime validation was limited to the unchanged binding logic. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: pi 1.1.0 -- 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]
