When you save a pipeline's transform rules or preview them, etlmcp checks every rule before it touches any data. If a rule is wrong, the save or the preview is refused with HTTP status 400, and the response's error field holds one message. Most messages name the operation and the position of the rule that failed, such as select (rule 0) needs a non-empty 'fields' list. Rules are counted from 0, so rule 0 is the first rule in the list and rule 3 is the fourth. Fix that rule and save again; the check stops at the first problem it finds, so a list with two mistakes reports them one at a time.
The messages below are written with {…} where etlmcp fills in a value: the rule's position, the operation's name, or a piece of your expression.
When the check runs
- Saving a pipeline. Creating a pipeline with rules, or changing the rules of an existing one, runs the check first. A refused save changes nothing: the pipeline keeps its earlier rules.
- Previewing rules. The preview runs the same check, then applies the rules to a demo row or to the sample rows you send. An error found while the rules run on those rows also comes back as a 400 with the message in
error. - Size. One pipeline holds at most 50 rules. A longer list is refused with a 400 before the rules are read. The whole list also has a size cap in bytes, refused with
rules are too large (max {…} KB).
Rule shape errors
Each rule is an object with an op key. These messages mean a key the operation needs is missing or has the wrong type.
| Message | What to fix |
|---|---|
unknown transform op: {…} (rule {…}) |
The op is not one of select, rename, filter, derive, constant, round, fx, group or limit. A missing op reports None. |
select (rule {…}) needs a non-empty 'fields' list |
Give fields as a list with at least one column name. |
rename (rule {…}) needs a 'map' dict |
Give map as an object from old name to new name. |
derive (rule {…}) needs 'as' |
Name the new column in as. |
filter (rule {…}) needs an 'expr' string, or the same with derive |
Give expr as a non-blank text expression. Both operations share the message {…} (rule {…}) needs an 'expr' string. |
constant (rule {…}) needs a 'set' dict |
Give set as an object of column names and values. Values may be numbers, text or empty; text has a length cap. |
round (rule {…}) needs a 'fields' dict |
Give fields as an object from column name to number of decimals, not a list. |
fx (rule {…}) needs 'field' and 'to' |
Name the amount column in field and the target currency in to. |
group (rule {…}) needs a non-empty 'by' list |
List at least one column to group by. |
group (rule {…}) agg must be sum/max/min/avg/count |
Set agg to one of those five words, or leave it out to sum. |
limit (rule {…}) needs integer 'n' |
Give n as a whole number. |
An fx rule with rates that comes after a rule which removes the currency column, such as a select or group that leaves it out, is refused too: the message says an earlier rule drops currency. Move the fx rule above that rule, or keep currency in it.
Expression errors
filter and derive rules carry an expression. etlmcp checks it by running it once against stand-in values, and prefixes any problem with the operation and rule position, for example filter (rule 2): unknown field 'roas'.
expression is too long (max {…} characters): one expression may hold at most 2000 characters. Split the logic across several rules.bad token at {…} in {…}: a character the expression language does not read, such as$,&or a quotation mark. Expressions hold column names, numbers, arithmetic, comparisons,and,or,notand parentheses. Text in quotes is not part of the language, so a comparison with a word such as a campaign name cannot be written.trailing tokens in expression at {…}: the expression ended where etlmcp expected it to, but more followed. Two common causes are a single=(write==) and two values with no operator between them, such ascost 2.unknown function {…}: the name before(is not one of the functions the language has:abs,min,max,round,floor,ceil,ln,log10andsqrt.exponent must be between -{…} and {…}: a power (**) whose exponent falls outside that range is refused.cannot evaluate: {…}: the expression is well formed but cannot be computed, for examplecurrency > 1, which orders the text columncurrencyagainst a number.
unknown field
unknown field {…} means the expression names a column the check does not know. Today the check knows cost, impressions, clicks, conversions, conversion_value, ctr, cpc, cpm, cpa, currency and date, plus any name that starts with extra. (a platform's own metrics) and the words true and false. Any other name is refused when you save, including campaign_name, roas and a column that an earlier derive rule creates. To filter on a ratio, write it out from the base columns: conversion_value / cost > 2 instead of roas > 2. Dividing by zero gives an empty value rather than an error.
Errors while a run applies the rules
Some problems only show up on real rows. The two from currency conversion are fx: no rate for {…} -> {…}, when a row is in a currency that the rule's rates do not cover, and fx: a row has no currency, when a row has no currency to convert from. Add the missing rate, or keep the currency column up to the fx rule.
In a preview, these come back as a 400 like the others. In a sync, a transform error fails the run at once: it is not retried, because the same rules would fail the same way, and the run's error shows the message. See run statuses and retries. A derive expression that cannot be computed for one row does not fail the run: that row's new column is left empty. A filter comparison with an empty value counts as false, so that row is dropped.