Skip to main content
Version: 0.95

operators.truncate.TruncatePreprocessor

class operators.truncate.TruncatePreprocessor(field, target_field=None, length=5000, by='words')

Truncates a column by given amount.

Truncates the given column (with string values) and writes result to the target field.

Parameters:
  • field (str) – The field you want to truncate

  • target_field (str) – The output field to write the truncated strings to

  • length (int) – The length to truncate to

  • by (str) – Whether to truncate to <length> ‘words’ or ‘chars’.