OpenBB-finance/OpenBB · error · OpenBBError

The 'main' indicator cannot be combined with other indicator

Error message

The 'main' indicator cannot be combined with other indicators.

What it means

OpenBBError from the symbol validator of EconDbEconomicIndicatorsQueryParams: the special pseudo-indicator 'main' (the EconDB main dashboard bundle) was supplied together with other symbols in a comma-separated list. 'main' is only valid as the sole symbol.

Source

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

    @field_validator("symbol", mode="before", check_fields=False)
    @classmethod
    def validate_symbols(cls, v):
        """Validate each symbol to check if it is a valid indicator."""
        # pylint: disable=import-outside-toplevel
        from openbb_econdb.utils import helpers

        INDICATORS = list(helpers.INDICATORS_DESCRIPTIONS)
        if not v:
            v = "main"
        symbols = v if isinstance(v, list) else v.split(",")
        new_symbols: list[str] = []
        for symbol in symbols:
            if "_" in symbol:
                new_symbols.append(symbol)
                continue
            if symbol.upper() == "MAIN":
                if len(symbols) > 1:
                    raise OpenBBError(
                        "The 'main' indicator cannot be combined with other indicators."
                    )
                return symbol
            if not any(
                (
                    symbol.upper().startswith(indicator)
                    if len(symbol) >= len(indicator)
                    else symbol.upper() == indicator
                )
                for indicator in INDICATORS
            ):
                warn(f"Invalid indicator: '{symbol}'.")
            else:
                new_symbols.append(symbol)
        if not new_symbols:
            raise OpenBBError(
                "No valid indicators provided. Please choose from: "
                + ",".join(INDICATORS)

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Remove 'main' from the list and query the concrete indicators you want (e.g. 'cpi,ryl').
  2. If you want the main dashboard set, issue a separate call with symbol='main' (and a single country — see error 293).
  3. Sanitize user input before the call: reject or split out 'main' when it appears with other symbols.

Example fix

# before
res = obb.economy.indicator(provider="econdb", symbol="main,cpi", country="us")

# after
main = obb.economy.indicator(provider="econdb", symbol="main", country="us")
cpi = obb.economy.indicator(provider="econdb", symbol="cpi", country="us")
Defensive patterns

Strategy: validation

Validate before calling

def split_main(symbols: list[str]) -> tuple[bool, list[str]]:
    has_main = any(s.upper() == "MAIN" for s in symbols)
    return has_main, [s for s in symbols if s.upper() != "MAIN"]
# if has_main and others: issue separate calls (main alone, single country)

Try / catch

from openbb_core.provider.utils.errors import OpenBBError
try:
    res = obb.economy.indicator(provider="econdb", symbol=syms, country=cs)
except OpenBBError as e:
    if "'main' indicator cannot be combined" in str(e):
        main = obb.economy.indicator(provider="econdb", symbol="main", country=cs)
        rest = [s for s in syms.split(",") if s.lower() != "main"]
        res = obb.economy.indicator(provider="econdb", symbol=",".join(rest), country=cs)
    else:
        raise

Prevention

When it happens

Trigger: Calling obb.economy.indicator(provider='econdb', symbol='main,cpi') or symbol=['main', 'GDP'] — the validator splits on commas, sees MAIN with len(symbols) > 1, and raises. Note: 'main_x' style symbols with underscores are exempt.

Common situations: User builds the symbol list dynamically and 'main' slips in as a default next to real indicators; copy-pasting an example that appended extra symbols to 'main'.

Related errors


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