OpenBB-finance/OpenBB · error · OpenBBError
Indicator {symbol} does not have countries.
Error message
Indicator {symbol} does not have countries. What it means
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'.
Source
Thrown at openbb_platform/providers/econdb/openbb_econdb/utils/helpers.py:351
"Uzbekistan",
"Kazakhstan",
"Bosnia And Herzegovina",
]
def parse_symbols(
symbol,
transform: str | None = None,
countries: str | list[str] | None = None,
):
"""Parse the indicator symbol with the optional transformation for a list of countries. Returns a string list."""
symbols = []
if not countries:
if transform:
symbol += "~" + transform
symbols.append(symbol)
elif countries and HAS_COUNTRIES.get(symbol, False) is False:
raise OpenBBError(f"Indicator {symbol} does not have countries.")
elif countries and HAS_COUNTRIES.get(symbol, False) is True:
countries = countries if isinstance(countries, list) else countries.split(",")
for country in countries:
new_country = (
"EA19"
if country == "EA" and (symbol in ["URATE", "POP", "GDEBT"])
else country
)
new_symbol = symbol + new_country
if transform:
new_symbol += "~" + transform
symbols.append(new_symbol)
return ",".join(symbols)
def unit_multiplier(unit: str) -> int: # pylint: disable=R0911
"""Return the multiplier for a given unit measurement."""View on GitHub (pinned to 3e071fcc2c)
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.
Example fix
# before
symbols = parse_symbols('GDP', transform='pct_change', countries='us,de') # raises
# after - request country-specific tickers directly
symbols = 'GDPUS,GDPDE' # or use a country-parameterized indicator:
symbols = parse_symbols('URATE', transform='pct_change', countries='us,de') Defensive patterns
Strategy: type-guard
Validate before calling
from openbb_econdb.utils.helpers import HAS_COUNTRIES, get_indicator_countries
if countries and not HAS_COUNTRIES.get(symbol, False):
raise ValueError(f'{symbol} does not take countries; use a country-specific ticker') Type guard
def indicator_takes_countries(symbol: str) -> bool:
from openbb_econdb.utils.helpers import HAS_COUNTRIES
return HAS_COUNTRIES.get(symbol, False) is True Try / catch
from openbb_core.app.model.obbject import OpenBBError
try:
symbols = parse_symbols(sym, transform=t, countries=cs)
except OpenBBError as e:
if 'does not have countries' in str(e):
symbols = sym # fall back to the bare ticker
else:
raise Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- The 'main' indicator cannot be combined with other indicator
- No valid indicators provided. Please choose from: ",".join(I
- The 'main' indicator cannot be combined with multiple countr
- Invalid symbol: '{symbol}'. It must have a two-letter countr
- Invalid transformation, '{_transform}', for symbol: '{_symbo
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/5ed225eab9e64c38.
Report an issue: GitHub.