docstr: Parameters
  ----------
  csv_path: str
      stock data path or directory
  qlib_dir: str
      qlib(dump) data director
  backup_dir: str, default None
      if backup_dir is not None, backup qlib_dir to backup_dir
  freq: str, default "day"
      transaction frequency
  max_workers: int, default None
      number of threads
  date_field_name: str, default "date"
      the name of the date field in the csv
  file_suffix: str, default ".csv"
      file suffix
  symbol_field_name: str, default "symbol"
      symbol field name
  include_fields: tuple
      dump fields
  exclude_fields: tuple
      fields not dumped
  limit_nums: int
      Use when debugging, default None
docstr_tok: ["Parameters","--","--","--","--","--","csv_path",":","str","stock","data","path","or","directory","qlib_dir",":","str","qlib","(","dump",")","data","director","backup_dir",":","str",",","default","None","if","backup_dir","is","not","None",",","backup","qlib_dir","to","backup_dir","freq",":","str",",","default","``","day","''","transaction","frequency","max_workers",":","int",",","default","None","number","of","threads","date_field_name",":","str",",","default","``","date","''","the","name","of","the","date","field","in","the","csv","file_suffix",":","str",",","default","``",".csv","''","file","suffix","symbol_field_name",":","str",",","default","``","symbol","''","symbol","field","name","include_fields",":","tuple","dump","fields","exclude_fields",":","tuple","fields","not","dumped","limit_nums",":","int","Use","when","debugging",",","default","None"]
code: def __init__(
      self,
      csv_path: str,
      qlib_dir: str,
      backup_dir: str = None,
      freq: str = "day",
      max_workers: int = 16,
      date_field_name: str = "date",
      file_suffix: str = ".csv",
      symbol_field_name: str = "symbol",
      exclude_fields: str = "",
      include_fields: str = "",
      limit_nums: int = None,
  ):
      """
  
      Parameters
      ----------
      csv_path: str
          stock data path or directory
      qlib_dir: str
          qlib(dump) data director
      backup_dir: str, default None
          if backup_dir is not None, backup qlib_dir to backup_dir
      freq: str, default "day"
          transaction frequency
      max_workers: int, default None
          number of threads
      date_field_name: str, default "date"
          the name of the date field in the csv
      file_suffix: str, default ".csv"
          file suffix
      symbol_field_name: str, default "symbol"
          symbol field name
      include_fields: tuple
          dump fields
      exclude_fields: tuple
          fields not dumped
      limit_nums: int
          Use when debugging, default None
      """
      super().__init__(
          csv_path,
          qlib_dir,
          backup_dir,
          freq,
          max_workers,
          date_field_name,
          file_suffix,
          symbol_field_name,
          exclude_fields,
          include_fields,
      )
      self._mode = self.UPDATE_MODE
      self._old_calendar_list = self._read_calendars(
          self._calendars_dir.joinpath(f"{self.freq}.txt")
      )
      # NOTE: all.txt only exists once for each stock
      # NOTE: if a stock corresponds to multiple different time ranges, user need to modify self._update_instruments
      self._update_instruments = (
          self._read_instruments(
              self._instruments_dir.joinpath(self.INSTRUMENTS_FILE_NAME)
          )
          .set_index([self.symbol_field_name])
          .to_dict(orient="index")
      )  # type: dict
  
      # load all csv files
      self._all_data = (
          self._load_all_source_data()
      )  # type: pd.DataFrame
      self._new_calendar_list = self._old_calendar_list + sorted(
          filter(
              lambda x: x > self._old_calendar_list[-1],
              self._all_data[self.date_field_name].unique(),
          )
      )
  
imports: import abc
  import shutil
  import traceback
  from pathlib import Path
  from typing import Iterable, List, Union
  from functools import partial
  from concurrent.futures import ThreadPoolExecutor, as_completed, ProcessPoolExecutor
  import fire
  import numpy
  import pandas
  from tqdm import tqdm
  from loguru import logger
  from qlib.utils import fname_to_code, code_to_fname
label_desc: Use image node_id 1 to create a new DumpDataUpdate object from inherited base classes: DumpDataBase with example: obj = DumpDataUpdate(csv_path, qlib_dir, backup_dir, freq, max_workers, date_field_name, file_suffix, symbol_field_name, exclude_fields, include_fields, limit_nums)