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_sample(self):
      df = self.connect.readTable(table_name=self.tbl_name)
      plan = (
          df.filter(df.col_name > 3)
          .sample(fraction=0.3)
          ._plan.to_proto(self.connect)
      )
      self.assertEqual(plan.root.sample.lower_bound, 0.0)
      self.assertEqual(plan.root.sample.upper_bound, 0.3)
      self.assertEqual(plan.root.sample.with_replacement, False)
      self.assertEqual(plan.root.sample.HasField("seed"), False)
      self.assertEqual(plan.root.sample.deterministic_order, False)
  
      plan = (
          df.filter(df.col_name > 3)
          .sample(withReplacement=True, fraction=0.4, seed=-1)
          ._plan.to_proto(self.connect)
      )
      self.assertEqual(plan.root.sample.lower_bound, 0.0)
      self.assertEqual(plan.root.sample.upper_bound, 0.4)
      self.assertEqual(plan.root.sample.with_replacement, True)
      self.assertEqual(plan.root.sample.seed, -1)
      self.assertEqual(plan.root.sample.deterministic_order, False)
  
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 21 for calling the SparkConnectPlanTests obj's underlying member method code with example usage: obj.test_sample() without return types