philo-he commented on code in PR #13149:
URL: https://github.com/apache/gluten/pull/13149#discussion_r4137310458
##########
gluten-core/src/main/scala/org/apache/gluten/extension/GlutenSessionExtensions.scala:
##########
@@ -58,4 +58,15 @@ private[gluten] class GlutenSessionExtensions
object GlutenSessionExtensions {
val GLUTEN_SESSION_EXTENSION_NAME: String =
classOf[GlutenSessionExtensions].getCanonicalName
val GLUTEN_ENABLE_FOR_THREAD_KEY: String = "gluten.enabledForCurrentThread"
+
+ // Visible for testing. Parse the per-thread enable flag, naming the
property and the
+ // offending value when it is not a boolean instead of surfacing a bare
`toBoolean` failure.
+ private[gluten] def isEnabledForThread(value: String): Boolean = {
+ try value.toBoolean
+ catch {
+ case _: IllegalArgumentException =>
+ throw new IllegalArgumentException(
+ s"$GLUTEN_ENABLE_FOR_THREAD_KEY should be boolean, but was $value")
Review Comment:
Thanks for the clarification. I feel an end-to-end test should be better. If
so, perhaps, not very necessary to keep this test dedicatedly for that small
piece of code.
--
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]