class_docstr: FileSystem implemented with arrow fs API (>=2.0.0).
class_docstr_tok: ["FileSystem","implemented","with","arrow","fs","API","(",">","=2.0.0",")","."]
code: def delete(self, path: path_type, recursive: bool = False):
      path = self._process_path(path)
      info = self._get_file_info(path)
      if info.is_file:
          self._arrow_fs.delete_file(path)
      elif info.type == FileType.Directory:
          if not recursive and len(self.ls(path)) > 0:
              raise OSError(f"[Errno 66] Directory not empty: '{path}'")
          self._arrow_fs.delete_dir(path)
      else:  # pragma: no cover
          raise TypeError(
              f"path({path}) to delete must be a file or directory"
          )
  
imports: import os
  import subprocess
  import weakref
  from urllib.parse import urlparse
  from typing import List, Dict, Union, Tuple, Iterator, BinaryIO, TextIO
  import pyarrow
  from pyarrow.fs import FileSystem, LocalFileSystem, HadoopFileSystem, FileSelector, FileInfo, FileType
  from ...utils import implements, stringify_path
  from .core import FileSystem, path_type
label_desc: Use image node_id 6 for calling the ArrowBasedFileSystem obj's underlying member method code with example usage: obj.delete(path, recursive) without return types