Transform: Date Shifting

class gretel_client.transformers.transformers.date_shift.DateShift(config: gretel_client.transformers.transformers.date_shift.DateShiftConfig)
config_class

alias of DateShiftConfig

class gretel_client.transformers.transformers.date_shift.DateShiftConfig(labels: List[str] = None, minimum_score: Optional[float] = None, lower_range_days: int = None, upper_range_days: int = None, secret: str = None, tweak: gretel_client.transformers.base.FieldRef = None, date_format: str = None)

Adjust a date/time string within a certain amount of bounds, using FPE.

Parameters
  • lower_range_days – The maximum number of days to adjust backwards in time.

  • upper_range_days – The maximum number of days to adjust forwards in time.

  • secret – Encryption key to use.

  • tweak – Optionally base the time shift on another field in the record.

  • date_format – (Optional) Specify desired input/output format in https://strftime.org/ syntax. If None, then the output format will always be formatted to “%m/%d/%Y”. If you specify a date_format string, it will first attempt to read the incoming value using this date format and fall back to a generic date parser if it fails. The output format however, will always be the one specified here or the default.