code: def write(
      self,
      df,
      path,
      compression="snappy",
      coerce_timestamps="ms",
      index=None,
      partition_cols=None,
      **kwargs,
  ):
      self.validate_dataframe(df)
      path, _, _, _ = get_filepath_or_buffer(path, mode="wb")
  
      if index is None:
          from_pandas_kwargs = {}
      else:
          from_pandas_kwargs = {"preserve_index": index}
      table = self.api.Table.from_pandas(df, **from_pandas_kwargs)
      if partition_cols is not None:
          self.api.parquet.write_to_dataset(
              table,
              path,
              compression=compression,
              coerce_timestamps=coerce_timestamps,
              partition_cols=partition_cols,
              **kwargs,
          )
      else:
          self.api.parquet.write_table(
              table,
              path,
              compression=compression,
              coerce_timestamps=coerce_timestamps,
              **kwargs,
          )
  
imports: from distutils.version import LooseVersion
  from warnings import catch_warnings
  from pandas.compat import string_types
  from pandas.errors import AbstractMethodError
  from pandas import DataFrame, get_option
  from pandas.io.common import get_filepath_or_buffer, is_s3_url
label_desc: Use image node_id 2 for calling the PyArrowImpl obj's underlying member method code with example usage: obj.write(df, path, compression, coerce_timestamps, index, partition_cols) without return types