{"record":{"id":"1448265c525a3468","repo":"OpenBB-finance/OpenBB","slug":"the-main-indicator-cannot-be-combined-with-other","errorCode":null,"errorMessage":"The 'main' indicator cannot be combined with other indicators.","messagePattern":"The 'main' indicator cannot be combined with other indicators\\.","errorType":"validation","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/econdb/openbb_econdb/models/economic_indicators.py","lineNumber":125,"sourceCode":"    @field_validator(\"symbol\", mode=\"before\", check_fields=False)\n    @classmethod\n    def validate_symbols(cls, v):\n        \"\"\"Validate each symbol to check if it is a valid indicator.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from openbb_econdb.utils import helpers\n\n        INDICATORS = list(helpers.INDICATORS_DESCRIPTIONS)\n        if not v:\n            v = \"main\"\n        symbols = v if isinstance(v, list) else v.split(\",\")\n        new_symbols: list[str] = []\n        for symbol in symbols:\n            if \"_\" in symbol:\n                new_symbols.append(symbol)\n                continue\n            if symbol.upper() == \"MAIN\":\n                if len(symbols) > 1:\n                    raise OpenBBError(\n                        \"The 'main' indicator cannot be combined with other indicators.\"\n                    )\n                return symbol\n            if not any(\n                (\n                    symbol.upper().startswith(indicator)\n                    if len(symbol) >= len(indicator)\n                    else symbol.upper() == indicator\n                )\n                for indicator in INDICATORS\n            ):\n                warn(f\"Invalid indicator: '{symbol}'.\")\n            else:\n                new_symbols.append(symbol)\n        if not new_symbols:\n            raise OpenBBError(\n                \"No valid indicators provided. Please choose from: \"\n                + \",\".join(INDICATORS)","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/econdb/openbb_econdb/models/economic_indicators.py#L107-L143","documentation":"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.","triggerScenarios":"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.","commonSituations":"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'.","solutions":["Remove 'main' from the list and query the concrete indicators you want (e.g. 'cpi,ryl').","If you want the main dashboard set, issue a separate call with symbol='main' (and a single country — see error 293).","Sanitize user input before the call: reject or split out 'main' when it appears with other symbols."],"exampleFix":"# before\nres = obb.economy.indicator(provider=\"econdb\", symbol=\"main,cpi\", country=\"us\")\n\n# after\nmain = obb.economy.indicator(provider=\"econdb\", symbol=\"main\", country=\"us\")\ncpi = obb.economy.indicator(provider=\"econdb\", symbol=\"cpi\", country=\"us\")","handlingStrategy":"validation","validationCode":"def split_main(symbols: list[str]) -> tuple[bool, list[str]]:\n    has_main = any(s.upper() == \"MAIN\" for s in symbols)\n    return has_main, [s for s in symbols if s.upper() != \"MAIN\"]\n# if has_main and others: issue separate calls (main alone, single country)","typeGuard":null,"tryCatchPattern":"from openbb_core.provider.utils.errors import OpenBBError\ntry:\n    res = obb.economy.indicator(provider=\"econdb\", symbol=syms, country=cs)\nexcept OpenBBError as e:\n    if \"'main' indicator cannot be combined\" in str(e):\n        main = obb.economy.indicator(provider=\"econdb\", symbol=\"main\", country=cs)\n        rest = [s for s in syms.split(\",\") if s.lower() != \"main\"]\n        res = obb.economy.indicator(provider=\"econdb\", symbol=\",\".join(rest), country=cs)\n    else:\n        raise","preventionTips":["Treat 'main' as its own request; never concatenate it with other symbols.","Strip 'main' from dynamically built symbol lists before the call."],"tags":["econdb","validation","symbols","query-params"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}