You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "HyukjinKwon (via GitHub)" <gi...@apache.org> on 2024/02/27 03:50:31 UTC

[PR] [MINOR][SS] Minor string representation improvement in AssertOnQuery [spark]

HyukjinKwon opened a new pull request, #45275:
URL: https://github.com/apache/spark/pull/45275

   ### What changes were proposed in this pull request?
   
   This PR changes `AssertOnQuery(<condition>, )` to `AssertOnQuery(<condition>)` when the message is empty.
   
   ### Why are the changes needed?
   
   Just to make it a little bit more prettier and readale.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, dev-inly.
   
   ### How was this patch tested?
   
   Manually.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.
   


-- 
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] [MINOR][SS] Minor string representation improvement in AssertOnQuery [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #45275:
URL: https://github.com/apache/spark/pull/45275#issuecomment-1965738139

   cc @HeartSaVioR FYI. I found this out while debugging sth :-)


-- 
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] [MINOR][SS] Minor string representation improvement in AssertOnQuery [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon closed pull request #45275: [MINOR][SS] Minor string representation improvement in AssertOnQuery
URL: https://github.com/apache/spark/pull/45275


-- 
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] [MINOR][SS] Minor string representation improvement in AssertOnQuery [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #45275:
URL: https://github.com/apache/spark/pull/45275#discussion_r1503711045


##########
sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala:
##########
@@ -284,7 +284,11 @@ trait StreamTest extends QueryTest with SharedSparkSession with TimeLimits with
   /** Assert that a condition on the active query is true */
   class AssertOnQuery(val condition: StreamExecution => Boolean, val message: String)
     extends StreamAction with StreamMustBeRunning {
-    override def toString: String = s"AssertOnQuery(<condition>, $message)"
+    override def toString: String = if (message == "") {

Review Comment:
   It won't be :-). This is for the case below:
   
   ```
       def apply(condition: StreamExecution => Boolean, message: String = ""): AssertOnQuery = {
         new AssertOnQuery(condition, message)
       }
   ```



-- 
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] [MINOR][SS] Minor string representation improvement in AssertOnQuery [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #45275:
URL: https://github.com/apache/spark/pull/45275#issuecomment-1965884273

   Merged to master.


-- 
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] [MINOR][SS] Minor string representation improvement in AssertOnQuery [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #45275:
URL: https://github.com/apache/spark/pull/45275#discussion_r1503682301


##########
sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala:
##########
@@ -284,7 +284,11 @@ trait StreamTest extends QueryTest with SharedSparkSession with TimeLimits with
   /** Assert that a condition on the active query is true */
   class AssertOnQuery(val condition: StreamExecution => Boolean, val message: String)
     extends StreamAction with StreamMustBeRunning {
-    override def toString: String = s"AssertOnQuery(<condition>, $message)"
+    override def toString: String = if (message == "") {

Review Comment:
   Is it only for `""`? What if the message is `"    "`? 



-- 
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