code: def to_avro(
      data: "ColumnOrName", jsonFormatSchema: str = ""
  ) -> Column:
      if jsonFormatSchema == "":
          return _invoke_function("to_avro", _to_col(data))
      else:
          return _invoke_function(
              "to_avro", _to_col(data), lit(jsonFormatSchema)
          )
  
file_path: spark/python/pyspark/sql/connect/avro/functions.py
imports: from pyspark.sql.connect.utils import check_dependencies
  from typing import Dict, Optional, TYPE_CHECKING
  from pyspark.sql.avro import functions
  from pyspark.sql.connect.column import Column
  from pyspark.sql.connect.functions.builtin import _invoke_function, _to_col, _options_to_col, lit
label_desc: Use image node_id 2 for calling a global function with example usage: to_avro(data, jsonFormatSchema) and returns: _invoke_function, _invoke_function