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_write_operation(self):
      wo = WriteOperation(self.connect.readTable("name")._plan)
      wo.mode = "overwrite"
      wo.source = "parquet"
  
      p = wo.command(None)
      self.assertIsNotNone(p)
      self.assertFalse(p.write_operation.HasField("path"))
      self.assertFalse(p.write_operation.HasField("table"))
  
      wo.path = "path"
      p = wo.command(None)
      self.assertIsNotNone(p)
      self.assertTrue(p.write_operation.HasField("path"))
      self.assertFalse(p.write_operation.HasField("table"))
  
      wo.path = None
      wo.table_name = "table"
      wo.table_save_method = "save_as_table"
      p = wo.command(None)
      self.assertFalse(p.write_operation.HasField("path"))
      self.assertTrue(p.write_operation.HasField("table"))
  
      wo.bucket_cols = ["a", "b", "c"]
      p = wo.command(None)
      self.assertFalse(p.write_operation.HasField("bucket_by"))
  
      wo.num_buckets = 10
      p = wo.command(None)
      self.assertTrue(p.write_operation.HasField("bucket_by"))
  
      # Unsupported save mode
      wo.mode = "unknown"
      with self.assertRaises(ValueError):
          wo.command(None)
  
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 37 for calling the SparkConnectPlanTests obj's underlying member method code with example usage: obj.test_write_operation() without return types