OpenBB-finance/OpenBB · error · OpenBBError

Invalid transformation, '{_transform}', for symbol: '{_symbo

Error message

Invalid transformation, '{_transform}', for symbol: '{_symbol}'.

What it means

OpenBBError for a malformed transformation suffix: the symbol's '~' suffix (e.g. 'CPI~yoy') is not one of the supported QUERY_TRANSFORMS. Single-symbol requests raise; multi-symbol requests warn, keep the un-transformed root, and continue.

Source

Thrown at openbb_platform/providers/econdb/openbb_econdb/models/economic_indicators.py:246

            if "~" in symbol:
                _symbol = symbol.split("~")[0]
                _transform = symbol.split("~")[1]
                if (
                    helpers.HAS_COUNTRIES.get(_symbol) is True
                    and _symbol in helpers.SYMBOL_TO_INDICATOR.values()
                ):
                    message = f"Invalid symbol: '{symbol}'. It must have a two-letter country code."
                    if len(symbols) > 1:
                        warn(message)
                        continue
                    raise OpenBBError(message)
                if _transform and _transform not in helpers.QUERY_TRANSFORMS:
                    message = f"Invalid transformation, '{_transform}', for symbol: '{_symbol}'."
                    if len(symbols) > 1:
                        warn(message)
                        new_symbols.append(_symbol)
                    else:
                        raise OpenBBError(message)
                elif not _transform:
                    new_symbols.append(symbol.replace("~", ""))
                else:
                    new_symbols.append(symbol)
            # Else we need to wrap each symbol with each country code
            # and check if the country is valid for that indicator.
            elif countries and helpers.HAS_COUNTRIES.get(symbol) is True:
                for country in countries:
                    _country = (
                        helpers.INDICATOR_COUNTRIES.get(symbol, [])
                        if country == "all"
                        else (
                            helpers.COUNTRY_GROUPS.get(country, [])
                            if country in helpers.COUNTRY_GROUPS
                            else (
                                [country.upper()]
                                if country.upper()
                                in helpers.INDICATOR_COUNTRIES.get(symbol, [])

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Use a transform from helpers.QUERY_TRANSFORMS — inspect them at runtime: from openbb_econdb.utils import helpers; print(helpers.QUERY_TRANSFORMS).
  2. Drop the '~suffix' entirely if you want the raw level series.
  3. In batches, watch warnings: an invalid transform falls back to the untransformed symbol rather than failing.

Example fix

# before
res = obb.economy.indicator(provider="econdb", symbol="cpi~pct")

# after
from openbb_econdb.utils import helpers
print(helpers.QUERY_TRANSFORMS)  # pick a valid key
res = obb.economy.indicator(provider="econdb", symbol="cpi~yoy")
Defensive patterns

Strategy: validation

Validate before calling

from openbb_econdb.utils import helpers

def valid_transform(symbol: str) -> bool:
    if "~" not in symbol:
        return True
    transform = symbol.split("~")[1]
    return not transform or transform in helpers.QUERY_TRANSFORMS

Try / catch

from openbb_core.provider.utils.errors import OpenBBError
try:
    res = obb.economy.indicator(provider="econdb", symbol=s, country=cs)
except OpenBBError as e:
    if "Invalid transformation" in str(e):
        res = obb.economy.indicator(provider="econdb", symbol=s.split("~")[0], country=cs)  # fall back to level
    else:
        raise

Prevention

When it happens

Trigger: Calling obb.economy.indicator(provider='econdb', symbol='cpi~percent') where '~percent' is not a valid transform (valid ones live in openbb_econdb.utils.helpers.QUERY_TRANSFORMS, e.g. yoy/period-over-period style keys).

Common situations: Guessing transform names instead of checking QUERY_TRANSFORMS; version drift if transform keys changed between provider releases; batch requests silently losing transformations (warning only) and returning level data the user mistakes for transformed data.

Related errors


AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14). Data as JSON: /api/errors/8cf62aae7e177fe9. Report an issue: GitHub.