class_docstr: A standard ``string.Formatter`` in Python that can understand pandas-on-Spark instances
  with basic Python objects. This object must be clear after the use for single SQL
  query; cannot be reused across multiple SQL queries without cleaning.
class_docstr_tok: ["A","standard","``","string.Formatter","``","in","Python","that","can","understand","pandas-on-Spark","instances","with","basic","Python","objects",".","This","object","must","be","clear","after","the","use","for","single","SQL","query",";","can","not","be","reused","across","multiple","SQL","queries","without","cleaning","."]
docstr: Converts the given value into a SQL string.
docstr_tok: ["Converts","the","given","value","into","a","SQL","string","."]
code: def _convert_value(self, val: Any, name: str) -> Optional[str]:
      """
      Converts the given value into a SQL string.
      """
      if isinstance(val, pd.Series):
          # Return the column name from pandas Series directly.
          return ps.from_pandas(val).to_frame()._to_spark().columns[0]
      elif isinstance(val, Series):
          # Return the column name of pandas-on-Spark Series iff its DataFrame was
          # referred. The check will be done in `vformat` after we parse all.
          self._ref_sers.append((val, name))
          return val.to_frame()._to_spark().columns[0]
      elif isinstance(val, (DataFrame, pd.DataFrame)):
          df_name = "_pandas_api_%s" % str(uuid.uuid4()).replace(
              "-", ""
          )
  
          if isinstance(val, pd.DataFrame):
              # Don't store temp view for plain pandas instances
              # because it is unable to know which pandas DataFrame
              # holds which Series.
              val = ps.from_pandas(val)
          else:
              for df, n in self._temp_views:
                  if df is val:
                      return n
              self._temp_views.append((val, df_name))
  
          val._to_spark().createOrReplaceTempView(df_name)
          return df_name
      elif isinstance(val, str):
          # This is matched to behavior from JVM implementation.
          # See `sql` definition from `sql/catalyst/src/main/scala/org/apache/spark/
          # sql/catalyst/expressions/literals.scala`
          return (
              "'" + val.replace("\\", "\\\\").replace("'", "\\'") + "'"
          )
      else:
          return val
  
imports: import os
  import string
  from typing import Any, Dict, Optional, Union, List, Sequence, Mapping, Tuple
  import uuid
  import warnings
  import pandas
  from pyspark.pandas.internal import InternalFrame
  from pyspark.pandas.namespace import _get_index_map
  from pyspark import pandas
  from pyspark.sql import SparkSession
  from pyspark.pandas.utils import default_session
  from pyspark.pandas.frame import DataFrame
  from pyspark.pandas.series import Series
  from pyspark.errors import PySparkTypeError
  from pyspark.sql.utils import is_remote
label_desc: Use image node_id 4 for calling the PandasSQLStringFormatter obj's underlying member method code with example usage: obj._convert_value(val, name) and returns: ps, val, df_name, unknown, val, n