You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "srowen (via GitHub)" <gi...@apache.org> on 2024/01/08 08:26:47 UTC

[PR] [SPARK-46611][CORE][FOLLOWUP] Correct new use of DateTimeFormat.withZone in UIUtils [spark]

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

   ### What changes were proposed in this pull request?
   
   Simplify code and fix new use of DateTimeFormat.withZone introduced in https://github.com/apache/spark/pull/44613 ; need to use the new object copy this creates.
   
   ### Why are the changes needed?
   
   Describing on mailing list from Janda Martin:
   
   ```
   DateTimeFormatter is thread-safe and immutable according to JavaDoc so method DateTimeFormatter::withZone returns new instance when zone is changed.
   
   Following code has no effect:
     val oldTimezones = (batchTimeFormat.getZone, batchTimeFormatWithMilliseconds.getZone)
     if (timezone != null) {
         val zoneId = timezone.toZoneId
         batchTimeFormat.withZone(zoneId)
         batchTimeFormatWithMilliseconds.withZone(zoneId)
       }
   
   Suggested fix:
   introduce local variables for "batchTimeFormat" and "batchTimeFormatWithMilliseconds" and remove "oldTimezones" and "finally" block.
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   Unlikely, the path in question is apparently test-only
   
   ### How was this patch tested?
   
   Existing tests
   
   ### 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] [SPARK-46611][CORE][FOLLOWUP] Correct new use of DateTimeFormat.withZone in UIUtils [spark]

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

   Build https://github.com/srowen/spark/actions/runs/7444863091


-- 
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-46611][CORE][FOLLOWUP] Correct new use of DateTimeFormat.withZone in UIUtils [spark]

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

   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] [SPARK-46611][CORE][FOLLOWUP] Correct new use of DateTimeFormat.withZone in UIUtils [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon closed pull request #44619: [SPARK-46611][CORE][FOLLOWUP] Correct new use of DateTimeFormat.withZone in UIUtils
URL: https://github.com/apache/spark/pull/44619


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