{"record":{"id":"5ed225eab9e64c38","repo":"OpenBB-finance/OpenBB","slug":"indicator-symbol-does-not-have-countries","errorCode":null,"errorMessage":"Indicator {symbol} does not have countries.","messagePattern":"Indicator (.+?) does not have countries\\.","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/econdb/openbb_econdb/utils/helpers.py","lineNumber":351,"sourceCode":"    \"Uzbekistan\",\n    \"Kazakhstan\",\n    \"Bosnia And Herzegovina\",\n]\n\n\ndef parse_symbols(\n    symbol,\n    transform: str | None = None,\n    countries: str | list[str] | None = None,\n):\n    \"\"\"Parse the indicator symbol with the optional transformation for a list of countries. Returns a string list.\"\"\"\n    symbols = []\n    if not countries:\n        if transform:\n            symbol += \"~\" + transform\n        symbols.append(symbol)\n    elif countries and HAS_COUNTRIES.get(symbol, False) is False:\n        raise OpenBBError(f\"Indicator {symbol} does not have countries.\")\n    elif countries and HAS_COUNTRIES.get(symbol, False) is True:\n        countries = countries if isinstance(countries, list) else countries.split(\",\")\n        for country in countries:\n            new_country = (\n                \"EA19\"\n                if country == \"EA\" and (symbol in [\"URATE\", \"POP\", \"GDEBT\"])\n                else country\n            )\n            new_symbol = symbol + new_country\n            if transform:\n                new_symbol += \"~\" + transform\n            symbols.append(new_symbol)\n\n    return \",\".join(symbols)\n\n\ndef unit_multiplier(unit: str) -> int:  # pylint: disable=R0911\n    \"\"\"Return the multiplier for a given unit measurement.\"\"\"","sourceCodeStart":333,"sourceCodeEnd":369,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/econdb/openbb_econdb/utils/helpers.py#L333-L369","documentation":"parse_symbols in openbb_econdb.utils.helpers raises OpenBBError when a countries argument is supplied for an indicator whose entry in the HAS_COUNTRIES map is not True — i.e. the EconDB ticker does not accept a country suffix (symbols like CPIAU do, single-country series like GDPUS do not). This guards against constructing invalid tickers such as 'GDPUS~US'.","triggerScenarios":"Calling an econdb-sourced endpoint (economy.econbibulk or internal helpers using parse_symbols) with both symbol='GDP' style indicator and countries='us' where that symbol is not country-parameterized in HAS_COUNTRIES.","commonSituations":"Assuming every indicator is country-suffixed; mixing up tickers that already embed a country with those that take one; stale HAS_COUNTRIES map after EconDB adds/removes parameterized series.","solutions":["Drop the countries argument for that symbol and request the country-specific ticker directly.","Check helpers.get_indicator_countries(symbol) / HAS_COUNTRIES to see which indicators accept countries.","Use a country-parameterized indicator (e.g. 'CPIAU' or 'URATE') when you need multi-country queries."],"exampleFix":"# before\nsymbols = parse_symbols('GDP', transform='pct_change', countries='us,de')  # raises\n\n# after - request country-specific tickers directly\nsymbols = 'GDPUS,GDPDE'  # or use a country-parameterized indicator:\nsymbols = parse_symbols('URATE', transform='pct_change', countries='us,de')","handlingStrategy":"type-guard","validationCode":"from openbb_econdb.utils.helpers import HAS_COUNTRIES, get_indicator_countries\nif countries and not HAS_COUNTRIES.get(symbol, False):\n    raise ValueError(f'{symbol} does not take countries; use a country-specific ticker')","typeGuard":"def indicator_takes_countries(symbol: str) -> bool:\n    from openbb_econdb.utils.helpers import HAS_COUNTRIES\n    return HAS_COUNTRIES.get(symbol, False) is True","tryCatchPattern":"from openbb_core.app.model.obbject import OpenBBError\ntry:\n    symbols = parse_symbols(sym, transform=t, countries=cs)\nexcept OpenBBError as e:\n    if 'does not have countries' in str(e):\n        symbols = sym  # fall back to the bare ticker\n    else:\n        raise","preventionTips":["Check HAS_COUNTRIES/get_indicator_countries before passing countries.","Use bare country-embedded tickers (e.g. 'GDPUS') for single-country series.","Keep a mapping of which econdb indicators are country-parameterized."],"tags":["validation","symbols","econdb","indicators"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}