{"record":{"id":"e5e60f464f9fe56f","repo":"OpenBB-finance/OpenBB","slug":"the-main-indicator-cannot-be-combined-with-multi","errorCode":null,"errorMessage":"The 'main' indicator cannot be combined with multiple countries.","messagePattern":"The 'main' indicator cannot be combined with multiple countries\\.","errorType":"validation","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/econdb/openbb_econdb/models/economic_indicators.py","lineNumber":178,"sourceCode":"    def transform_query(params: dict[str, Any]) -> EconDbEconomicIndicatorsQueryParams:\n        \"\"\"Transform the query parameters.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from datetime import timedelta\n\n        new_params = params.copy()\n        if new_params.get(\"start_date\") is None:\n            new_params[\"start_date\"] = (\n                datetime.today() - timedelta(weeks=52 * 11)\n            ).date()\n        if new_params.get(\"end_date\") is None:\n            new_params[\"end_date\"] = datetime.today().date()\n        countries = new_params.get(\"country\")\n        if (\n            countries is not None\n            and len(countries.split(\",\")) > 1\n            and new_params.get(\"symbol\", \"\").upper() == \"MAIN\"\n        ):\n            raise OpenBBError(\n                \"The 'main' indicator cannot be combined with multiple countries.\"\n            )\n        return EconDbEconomicIndicatorsQueryParams(**new_params)\n\n    @staticmethod\n    async def aextract_data(  # pylint: disable=R0914.R0912,R0915\n        query: EconDbEconomicIndicatorsQueryParams,\n        credentials: dict[str, str] | None,\n        **kwargs: Any,\n    ) -> list[dict]:\n        \"\"\"Extract the data.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from openbb_econdb.utils import helpers\n        from openbb_econdb.utils.main_indicators import get_main_indicators\n\n        if query.symbol.upper() == \"MAIN\":\n            country = query.country.upper() if query.country else \"US\"\n","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/econdb/openbb_econdb/models/economic_indicators.py#L160-L196","documentation":"OpenBBError from EconDbEconomicIndicatorsFetcher.generate_query_params: the pseudo-indicator 'main' was combined with a country parameter containing more than one country. EconDB's main bundle is per-country, so the fetcher refuses instead of issuing a combinatorial request.","triggerScenarios":"Calling obb.economy.indicator(provider='econdb', symbol='main', country='us,de') or country='g20' (groups expand to multiple comma-joined countries and also trip the >1 check).","commonSituations":"Using 'g20' or 'eurozone' style group aliases together with symbol='main'; looping over countries and accidentally passing the full list string in one call.","solutions":["Issue one call per country when symbol='main': loop ['us','de'] and pass a single code each time.","Or drop 'main' and request specific indicators, which do support multi-country queries.","Expand group aliases yourself before the call so each request has exactly one country."],"exampleFix":"# before\nres = obb.economy.indicator(provider=\"econdb\", symbol=\"main\", country=\"us,de\")\n\n# after\nframes = [obb.economy.indicator(provider=\"econdb\", symbol=\"main\", country=c).to_df() for c in (\"us\", \"de\")]","handlingStrategy":"validation","validationCode":"def is_main_query(symbol: str, country: str | None) -> bool:\n    return symbol.upper() == \"MAIN\" and country is not None and len(country.split(\",\")) > 1\n# loop per-country when true","typeGuard":null,"tryCatchPattern":"from openbb_core.provider.utils.errors import OpenBBError\ntry:\n    res = obb.economy.indicator(provider=\"econdb\", symbol=\"main\", country=cs)\nexcept OpenBBError as e:\n    if \"multiple countries\" in str(e):\n        res = [obb.economy.indicator(provider=\"econdb\", symbol=\"main\", country=c) for c in cs.split(\",\")]\n    else:\n        raise","preventionTips":["Remember group aliases like 'g20' expand to multiple countries and also trip this guard.","Issue one call per country for symbol='main'."],"tags":["econdb","validation","symbols","country-codes"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}