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

Re: [PR] [SPARK-45688][SPARK-45693][CORE] Clean up the deprecated API usage related to `MapOps` & Fix `method += in trait Growable is deprecated` [spark]

LuciferYang commented on code in PR #43578:
URL: https://github.com/apache/spark/pull/43578#discussion_r1378433085


##########
core/src/test/scala/org/apache/spark/util/TimeStampedHashMapSuite.scala:
##########
@@ -118,18 +118,18 @@ class TimeStampedHashMapSuite extends SparkFunSuite {
       assert(testMap2.iterator.toSeq.head === (("k1", "v1")))
 
       // +
-      val testMap3 = testMap2 + (("k0", "v0"))
+      val testMap3 = testMap2 ++ Map("k0" -> "v0")
       assert(testMap3.size === 2)
       assert(testMap3.get("k1").isDefined)
       assert(testMap3("k1") === "v1")
       assert(testMap3.get("k0").isDefined)
       assert(testMap3("k0") === "v0")
 
       // -
-      val testMap4 = testMap3 - "k0"
-      assert(testMap4.size === 1)
-      assert(testMap4.get("k1").isDefined)
-      assert(testMap4("k1") === "v1")
+      testMap3.remove("k0")

Review Comment:
   Not sure if this modification aligns with the original test objective.
   
   



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