class_docstr: These test cases exercise the interface to the proto plan
  generation but do not call Spark.
class_docstr_tok: ["These","test","cases","exercise","the","interface","to","the","proto","plan","generation","but","do","not","call","Spark","."]
code: def test_replace(self):
      # SPARK-41315: Test replace
      df = self.connect.readTable(table_name=self.tbl_name)
  
      plan = df.replace(10, 20)._plan.to_proto(self.connect)
      self.assertEqual(plan.root.replace.cols, [])
      self.assertEqual(
          plan.root.replace.replacements[0].old_value.double, 10.0
      )
      self.assertEqual(
          plan.root.replace.replacements[0].new_value.double, 20.0
      )
  
      plan = df.na.replace(
          (1, 2, 3), (4, 5, 6), subset=("col_a", "col_b")
      )._plan.to_proto(self.connect)
      self.assertEqual(plan.root.replace.cols, ["col_a", "col_b"])
      self.assertEqual(
          plan.root.replace.replacements[0].old_value.double, 1.0
      )
      self.assertEqual(
          plan.root.replace.replacements[0].new_value.double, 4.0
      )
      self.assertEqual(
          plan.root.replace.replacements[1].old_value.double, 2.0
      )
      self.assertEqual(
          plan.root.replace.replacements[1].new_value.double, 5.0
      )
      self.assertEqual(
          plan.root.replace.replacements[2].old_value.double, 3.0
      )
      self.assertEqual(
          plan.root.replace.replacements[2].new_value.double, 6.0
      )
  
      plan = df.replace(
          ["Alice", "Bob"], ["A", "B"], subset="col_x"
      )._plan.to_proto(self.connect)
      self.assertEqual(plan.root.replace.cols, ["col_x"])
      self.assertEqual(
          plan.root.replace.replacements[0].old_value.string, "Alice"
      )
      self.assertEqual(
          plan.root.replace.replacements[0].new_value.string, "A"
      )
      self.assertEqual(
          plan.root.replace.replacements[1].old_value.string, "Bob"
      )
      self.assertEqual(
          plan.root.replace.replacements[1].new_value.string, "B"
      )
  
imports: import unittest
  import uuid
  import datetime
  import decimal
  import math
  from pyspark.testing.connectutils import PlanOnlyTestFixture, should_test_connect, connect_requirement_message
  from pyspark.errors import PySparkValueError
label_desc: Use image node_id 10 for calling the SparkConnectPlanTests obj's underlying member method code with example usage: obj.test_replace() without return types