You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/06/03 12:51:24 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #28718: [SPARK-31892][SQL][FOLLOWUP] Improve test coverage for valid pattern …

cloud-fan commented on a change in pull request #28718:
URL: https://github.com/apache/spark/pull/28718#discussion_r434542000



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeFormatterHelperSuite.scala
##########
@@ -23,43 +23,49 @@ import org.apache.spark.sql.catalyst.util.DateTimeFormatterHelper._
 class DateTimeFormatterHelperSuite extends SparkFunSuite {
 
   test("check incompatible pattern") {
-    assert(convertIncompatiblePattern("MM-DD-u") === "MM-DD-e")
-    assert(convertIncompatiblePattern("yyyy-MM-dd'T'HH:mm:ss.SSSz")
-      === "uuuu-MM-dd'T'HH:mm:ss.SSSz")
-    assert(convertIncompatiblePattern("yyyy-MM'y contains in quoted text'HH:mm:ss")
-      === "uuuu-MM'y contains in quoted text'HH:mm:ss")
-    assert(convertIncompatiblePattern("yyyy-MM-dd-u'T'HH:mm:ss.SSSz")
+    assert(convertIncompatiblePattern("MM-DD-u", isParsing = false) === "MM-DD-e")

Review comment:
       In this test suite, how about we add
   ```
   def convertIncompatiblePattern(pattern: String): String = {
     convertIncompatiblePattern(pattern, isParsing = false)
   }
   ```
   To reduce the code diff?




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

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