Skip to Content
This documentation is provided with the HEAT environment and is relevant for this HEAT instance only.
RunnersCore UtilsTabular Remap Node

tabular-remap (Transform Node)

The Tabular Remap node transforms a tabular dataset (CSV or TSV) into a new format by applying column-level operations defined in its configuration.

This node is ideal for standardizing schema, renaming columns, creating derived metrics, or injecting constants before data aggregation.


Configuration Schema

PropertyTypeRequiredDescription
inputFormat"auto" | "csv" | "tsv"✖How to parse the input file. Defaults to "auto".
outputFormat"csv" | "tsv"✖Format of the output. Defaults to "csv".
failOnMissingColumnsboolean✖If true, the node fails when a rename source column does not exist.
treatEmptyAsNoneboolean✖When enabled, empty strings are interpreted as None in transform expressions.
columnsarray<object>✔List of column operations (rename, transform, constant). Evaluated by ascending priority.

Each columns[] entry supports:

FieldRequiredDescription
name✔Name of the output column.
priority✖Execution order (lower values run first). Defaults to insertion order.
action✔"rename", "transform", or "constant".
sourceonly for renameSource column name to copy from.
expronly for transformPython expression evaluated against the input row (variable: row).
valueonly for constantStatic value assigned to the column.

Example Configuration

{ "inputFormat": "auto", "outputFormat": "csv", "failOnMissingColumns": true, "treatEmptyAsNone": true, "columns": [ { "name": "timestamp", "priority": 10, "action": "rename", "source": "time" }, { "name": "driver", "priority": 20, "action": "rename", "source": "driver_name" }, { "name": "speed_kph", "priority": 30, "action": "transform", "expr": "float(row['speed_mps']) * 3.6 if row['speed_mps'] is not None else None" }, { "name": "unit", "priority": 40, "action": "constant", "value": "kph" } ] }

Example Input and Output

Input CSV:

time,driver_name,speed_mps 2025-01-01T00:00:00Z,Alice,10 2025-01-01T00:00:01Z,Bob,12.5

Output CSV:

timestamp,driver,speed_kph,unit 2025-01-01T00:00:00Z,Alice,36.0,kph 2025-01-01T00:00:01Z,Bob,45.0,kph

Transform Expression Context

Transform expressions execute within a safe, sandboxed Python environment:

  • Access the current row as row['column_name'].
  • Built-ins available: math, float, int, str, len, min, max, sum, abs, round.
  • Empty strings become None if treatEmptyAsNone is true.

Example:

{ "name": "speed_category", "action": "transform", "expr": "'fast' if float(row['speed_kph']) > 40 else 'slow'" }

Example: Mixed Operations

Configuration:

{ "columns": [ { "name": "C1", "priority": 10, "action": "rename", "source": "a" }, { "name": "C2", "priority": 20, "action": "transform", "expr": "int(row['b']) + 5" }, { "name": "C3", "priority": 30, "action": "constant", "value": "processed" } ] }

Input CSV:

a,b 1,2 3,4

Output CSV:

C1,C2,C3 1,7,processed 3,9,processed

Error Handling

ScenarioBehavior
Missing required column (when failOnMissingColumns=true)Node fails with descriptive log message.
Invalid Python expressionNode fails, logs the exception.
Empty input payloadNode fails gracefully and aborts downstream processing.

Tips & Best Practices

  • Define explicit priority values if later columns depend on earlier ones.
  • Keep expressions short , complex logic should be precomputed upstream.
  • Always quote string literals in expressions.
  • Use treatEmptyAsNone to simplify numeric casts in mixed data sources.
  • Ensure downstream nodes expect the same delimiter as outputFormat.