You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "yaooqinn (via GitHub)" <gi...@apache.org> on 2023/08/25 06:57:02 UTC

[GitHub] [spark] yaooqinn opened a new pull request, #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   This pull request eliminates the unnecessary use of escape for error summary cells.
   
   Previously, all the error details and some of the error summaries, such as the Task list on the stage page, did not call escapeHtml4. The rest of the error summaries, such as Job list, Stage list, Query list, etc., will do an extra escapeHtml4 that is unnecessary.
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   UI improvement
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   UI changes
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   
   #### new tests
   #### Local test
   
   ##### Before
   
   ![image](https://github.com/apache/spark/assets/8326978/f65e0713-087f-47a0-9cc9-321898ec6e6c)
   
   ##### After
   
   ![image](https://github.com/apache/spark/assets/8326978/e07c06f5-72ab-4465-b950-3e51350a3046)
   
   ### Was this patch authored or co-authored using generative AI tooling?
   <!--
   If generative AI tooling has been used in the process of authoring this patch, please include the
   phrase: 'Generated-by: ' followed by the name of the tool and its version.
   If no, write 'No'.
   Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
   -->
   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


[GitHub] [spark] yaooqinn commented on pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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

   The example in PR desc prints too many infrequently used characters  I apologize for any confusion caused. 


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


[GitHub] [spark] yaooqinn commented on pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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

   cc @sarutak @HyukjinKwon @cloud-fan @dongjoon-hyun, thanks


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


[GitHub] [spark] yaooqinn commented on pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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

   > The second example just shows <> which can't the 'right' version of whatever this is
   
   It's the source code version, the rendered HTML.
   
   > What happened to the garbled text
   
   There is no garbled text, and these are all Latin-1.
   
   FYI, https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/translate/EntityArrays.java#L39


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


[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #42674:
URL: https://github.com/apache/spark/pull/42674#discussion_r1305821221


##########
core/src/main/scala/org/apache/spark/ui/UIUtils.scala:
##########
@@ -709,7 +708,7 @@ private[spark] object UIUtils extends Logging {
 
   private final val ERROR_CLASS_REGEX = """\[(?<errorClass>[A-Z][A-Z_.]+[A-Z])]""".r
 
-  private def errorSummary(errorMessage: String): (String, Boolean) = {
+  def errorSummary(errorMessage: String): (String, Boolean) = {

Review Comment:
   Given that we have `private[spark] object UIUtils`, this looks okay.



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


[GitHub] [spark] yaooqinn commented on pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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

   The page source code
   ```
   Job aborted due to stage failure: ...: java.lang.RuntimeException: &quot;&lt;&gt;©
   ```
   It shows that the basic characters like `"<>` are already escaped as `&quot;&lt;&gt`. While, the Latin-1, such as the copyright © above, is supported by web browsers by default 


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


[GitHub] [spark] yaooqinn commented on a diff in pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/ui/SparkConnectServerPage.scala:
##########
@@ -330,24 +328,10 @@ private[ui] class SqlStatsPagedTable(
       <td>
         {sqlStatsTableRow.sparkSessionTags.mkString(", ")}
       </td>
-      {errorMessageCell(Option(info.detail))}
+      {UIUtils.errorMessageCell(Option(info.detail).getOrElse(""))}

Review Comment:
   The variable is initially set to an empty string and is then assigned to the value of `e.errorMessage` when an error occurs. It appears that `e.errorMessage` can be null in certain situations.



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


[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #42674:
URL: https://github.com/apache/spark/pull/42674#discussion_r1305821847


##########
sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryPage.scala:
##########
@@ -201,7 +186,13 @@ private[ui] class StreamingQueryPagedTable(
       <td>{withNoProgress(streamingQuery, {"%.2f".format(query.avgInput)}, "NaN")}</td>
       <td>{withNoProgress(streamingQuery, {"%.2f".format(query.avgProcess)}, "NaN")}</td>
       <td>{withNoProgress(streamingQuery, {streamingQuery.lastProgress.batchId}, "NaN")}</td>
-      {details(streamingQuery.summary.exception.getOrElse("-"))}
+      {
+        if (isActive) {
+          Seq.empty[Node]
+        } else {
+          SparkUIUtils.errorMessageCell(streamingQuery.summary.exception.getOrElse("-"))
+        }

Review Comment:
   Shall we keep `details` method and put thes 6 lines there?



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


[GitHub] [spark] srowen commented on pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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

   OK I believe this, but it's strange, the garbled text you show does not seem to be the result of double-escaping HTML? You'd find output that reads like `&lt;` or something


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


[GitHub] [spark] srowen commented on pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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

   I don't quite follow - the error message actually looks as if it's messed up to begin with and is some bytes being interpreted as Latin-1. The second example just shows `<>` which can't the 'right' version of whatever this is. What happened to the garbled text? that much doesn't seem to be related to HTML escaping, so just trying to make the connection between the problem you show and the solution


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


[GitHub] [spark] srowen commented on pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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

   Sorry, what was the original error message meant to be? It is clearly not text but some binary data rendered as text. You are saying that was intended, but was double escaped? But then it just disappears into angle brackets. I still don't understand what this case was showing. Would it help to show the HTML source before and after, just a small snippet of it? I can't yet see how this was the issue fixed by this change, though I trust there is a connection 


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


[GitHub] [spark] yaooqinn commented on a diff in pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/ui/SparkConnectServerPage.scala:
##########
@@ -330,24 +328,10 @@ private[ui] class SqlStatsPagedTable(
       <td>
         {sqlStatsTableRow.sparkSessionTags.mkString(", ")}
       </td>
-      {errorMessageCell(Option(info.detail))}
+      {UIUtils.errorMessageCell(Option(info.detail).getOrElse(""))}

Review Comment:
   The variable is initially set to an empty string and is then assigned to the value of `e.errorMessage` when an error occurs. It appears that `e.errorMessage` can be null in certain situations.



##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/ui/SparkConnectServerPage.scala:
##########
@@ -330,24 +328,10 @@ private[ui] class SqlStatsPagedTable(
       <td>
         {sqlStatsTableRow.sparkSessionTags.mkString(", ")}
       </td>
-      {errorMessageCell(Option(info.detail))}
+      {UIUtils.errorMessageCell(Option(info.detail).getOrElse(""))}

Review Comment:
   The variable is initially set to an empty string and is then assigned to the value of `e.errorMessage` when an error occurs. It appears that `e.errorMessage` can be null in certain situations.



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


[GitHub] [spark] srowen commented on pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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

   That makes much more sense to me. I don't quite understand the example in the original message above, in comparison.


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


[GitHub] [spark] yaooqinn commented on pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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

   Thank you, @dongjoon-hyun. I have made the necessary updates to the PR based on your suggestions.


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


[GitHub] [spark] yaooqinn commented on pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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

   thanks @srowen @gengliangwang @sarutak @HyukjinKwon @dongjoon-hyun, 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


[GitHub] [spark] yaooqinn commented on pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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

   https://github.com/apache/spark/pull/42674/files#diff-525465a6c6c1382bf8165da748522ec2387581ebd397fe25f5aa72107a45752aR119-R120, All the characters are here.
   
   In the PR description, I described the issue
   > Previously, all the error details and some of the error summaries, such as the Task list on the stage page, did not call escapeHtml4. The rest of the error summaries, such as Job list, Stage list, Query list, etc., will do an extra escapeHtml4 that is unnecessary.
   
   For example, if we initially throw a RuntimeException("<"). Those places that did not call escapeHtml4 display the message `java.lang.RuntimeException: <`, while the others that call escapeHtml4 show `java.lang.RuntimeException: &lt;`. You can also view the picture below with spark 3.4.1.
   
   ![image](https://github.com/apache/spark/assets/8326978/383e40bf-08d7-43d2-9c90-f6e05f16ccf2)
   


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


[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #42674:
URL: https://github.com/apache/spark/pull/42674#discussion_r1305822961


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/ui/UISeleniumSuite.scala:
##########
@@ -103,4 +113,16 @@ class UISeleniumSuite extends SparkFunSuite with WebBrowser {
       assert(planDetails.head.contains("TABLE_OR_VIEW_NOT_FOUND"))
     }
   }
+
+  test("Escape html is not necessary") {

Review Comment:
   nit.
   ```scala
   - test("Escape html is not necessary") {
   + test("SPARK-44960: Escape html is not necessary") {
   ```



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


[GitHub] [spark] sarutak commented on a diff in pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/ui/SparkConnectServerPage.scala:
##########
@@ -330,24 +328,10 @@ private[ui] class SqlStatsPagedTable(
       <td>
         {sqlStatsTableRow.sparkSessionTags.mkString(", ")}
       </td>
-      {errorMessageCell(Option(info.detail))}
+      {UIUtils.errorMessageCell(Option(info.detail).getOrElse(""))}

Review Comment:
   Can `info.detail` be `null`? If it cannot, can we just pass `info.detail` to `errorMessageCell`?



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


[GitHub] [spark] sarutak commented on a diff in pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/ui/SparkConnectServerPage.scala:
##########
@@ -330,24 +328,10 @@ private[ui] class SqlStatsPagedTable(
       <td>
         {sqlStatsTableRow.sparkSessionTags.mkString(", ")}
       </td>
-      {errorMessageCell(Option(info.detail))}
+      {UIUtils.errorMessageCell(Option(info.detail).getOrElse(""))}

Review Comment:
   Hmm, one option could be make `errorMessageCell` null-safe, but I think it's O.K to leave it as it 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


[GitHub] [spark] yaooqinn commented on pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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

   Hi @srowen, it actually removes double-escaping


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


[GitHub] [spark] yaooqinn closed pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn closed pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages
URL: https://github.com/apache/spark/pull/42674


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


[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #42674:
URL: https://github.com/apache/spark/pull/42674#discussion_r1305825910


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/ui/UISeleniumSuite.scala:
##########
@@ -103,4 +113,16 @@ class UISeleniumSuite extends SparkFunSuite with WebBrowser {
       assert(planDetails.head.contains("TABLE_OR_VIEW_NOT_FOUND"))
     }
   }
+
+  test("Escape html is not necessary") {
+    spark = creatSparkSessionWithUI
+    val escape = (BASIC_ESCAPE.keySet().asScala.toSeq ++ ISO8859_1_ESCAPE.keySet().asScala ++
+      HTML40_EXTENDED_ESCAPE.keySet().asScala).mkString
+    val errorMsg = escapeJava(escape.mkString)
+    intercept[Exception](spark.sql(s"SELECT raise_error('$errorMsg')").collect())

Review Comment:
   Although we don't care about the exceptions, shall we?
   - `RuntimeException` instead of `Exception`?
   - Check the error 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


[GitHub] [spark] srowen commented on pull request #42674: [SPARK-44960][UI] Unescape and consist error summary across UI pages

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

   Sorry for the perhaps silly question, but does this mean that some error messages or traces are displayed without any escaping? or is this only removing double-escaping?


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