class_docstr: Class which contains methods for data preprocessing.
  The class performs two types of preprocessing: obligatory and optional.
  
  obligatory - deletes rows where nans in the target, removes features,
      which full of nans, deletes extra_spaces
  optional - depends on what operations are in the pipeline, gap-filling
      is applied if there is no imputation operation in the pipeline, categorical
      encoding is applied if there is no encoder in the structure of the pipeline etc.
class_docstr_tok: ["Class","which","contains","methods","for","data","preprocessing",".","The","class","performs","two","types","of","preprocessing",":","obligatory","and","optional",".","obligatory","-","deletes","rows","where","nans","in","the","target",",","removes","features",",","which","full","of","nans",",","deletes","extra_spaces","optional","-","depends","on","what","operations","are","in","the","pipeline",",","gap-filling","is","applied","if","there","is","no","imputation","operation","in","the","pipeline",",","categorical","encoding","is","applied","if","there","is","no","encoder","in","the","structure","of","the","pipeline","etc","."]
code: def update_indices_for_time_series(
      self, test_data: Union[InputData, MultiModalData]
  ):
      if test_data.task.task_type is not TaskTypesEnum.ts_forecasting:
          return test_data
  
      values = (
          [test_data]
          if isinstance(test_data, InputData)
          else test_data.values()
      )
      for input_data in values:
          forecast_len = input_data.task.task_params.forecast_length
          if forecast_len < len(input_data.idx):
              last_id = len(input_data.idx)
              input_data.idx = np.arange(
                  last_id,
                  last_id + input_data.task.task_params.forecast_length,
              )
      return test_data
  
imports: from copy import copy
  from typing import Optional, Union
  import numpy
  import pandas
  from golem.core.log import default_log
  from golem.core.paths import copy_doc
  from sklearn.preprocessing import LabelEncoder
  from fedot.core.data.data import InputData, np_datetime_to_numeric
  from fedot.core.data.data import OutputData, data_type_is_table, data_type_is_text, data_type_is_ts
  from fedot.core.data.data_preprocessing import data_has_categorical_features, data_has_missing_values, find_categorical_columns, replace_inf_with_nans, replace_nans_with_empty_strings
  from fedot.core.data.multi_modal import MultiModalData
  from fedot.core.operations.evaluation.operation_implementations.data_operations.categorical_encoders import LabelEncodingImplementation, OneHotEncodingImplementation
  from fedot.core.operations.evaluation.operation_implementations.data_operations.sklearn_transformations import ImputationImplementation
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.tasks import TaskTypesEnum
  from fedot.preprocessing.base_preprocessing import BasePreprocessor
  from fedot.preprocessing.categorical import BinaryCategoricalPreprocessor
  from fedot.preprocessing.data_type_check import exclude_image, exclude_multi_ts, exclude_ts
  from fedot.preprocessing.data_types import TYPE_TO_ID, TableTypesCorrector
  from fedot.preprocessing.structure import DEFAULT_SOURCE_NAME, PipelineStructureExplorer
label_desc: Use image node_id 27 for calling the DataPreprocessor obj's underlying member method code with example usage: obj.update_indices_for_time_series(test_data) and returns: test_data, test_data