You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2026/05/06 14:45:19 UTC
[PR] [MINOR][SQL][TESTS] Inline unnecessary asInstanceOf[classic.SparkSession] cast in QueryTest [spark]
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55910][SQL][TESTS][FOLLOW-UP] Inline unnecessary asInstanceOf[classic.SparkSession] cast in QueryTest [spark]
Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #55715:
URL: https://github.com/apache/spark/pull/55715#issuecomment-4394046064
merged to master/4.x
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55910][SQL][TESTS][FOLLOW-UP] Inline unnecessary asInstanceOf[classic.SparkSession] cast in QueryTest [spark]
Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #55715: [SPARK-55910][SQL][TESTS][FOLLOW-UP] Inline unnecessary asInstanceOf[classic.SparkSession] cast in QueryTest
URL: https://github.com/apache/spark/pull/55715
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org