zhengruifeng opened a new pull request, #55715: URL: https://github.com/apache/spark/pull/55715
### What changes were proposed in this pull request? In `QueryTest.withQueryExecutionsCaptured`, the local alias `classicSession = spark.asInstanceOf[classic.SparkSession]` is replaced with direct uses of `spark`. The cast is not needed: `sparkContext` (`api/SparkSession.scala:72`) and `listenerManager` (`api/SparkSession.scala:144`) are both declared on the abstract `org.apache.spark.sql.SparkSession`, so they are accessible without converting to the classic implementation. ### Why are the changes needed? Cleanup follow-up to #55339, which removed unnecessary `asInstanceOf[classic.Dataset]` casts in `QueryTest`. The same criterion applies here: when the called API is already on the abstract type, the explicit classic cast adds noise and obscures which code paths actually depend on classic-only functionality. ### Does this PR introduce _any_ user-facing change? No. Test-only. ### How was this patch tested? `build/sbt sql/Test/compile` succeeds. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.7) -- 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]
