OpenBB-finance/OpenBB · error · OpenBBError

Results not found.

Error message

Results not found.

What it means

Raised by the economic-indicators model validator when no country can be determined: the `country` field is empty AND no dimension_values entry used one of the country dimension IDs (COUNTRY, REF_AREA, JURISDICTION, AREA), which would have been consumed into `self.country` earlier in the validator. Country is mandatory for IMF data queries, so validation aborts.

Source

Thrown at openbb_platform/core/openbb_core/app/model/obbject.py:169

        ascending: Optional[bool]
            Sort by ascending for each column specified in `sort_by`.

        Returns
        -------
        DataFrame
            Pandas DataFrame.
        """
        # pylint: disable=import-outside-toplevel
        from pandas import DataFrame, Series, concat  # noqa
        from openbb_core.app.utils import basemodel_to_df  # noqa

        def is_list_of_basemodel(items: list[T] | T) -> bool:
            return isinstance(items, list) and all(
                isinstance(item, BaseModel) for item in items
            )

        if self.results is None or not self.results:
            raise OpenBBError("Results not found.")

        if isinstance(self.results, DataFrame):
            return self.results

        try:
            res = self.results
            df = None
            sort_columns = True

            # BaseModel
            if isinstance(res, BaseModel):
                res_dict = res.model_dump(  # pylint: disable=no-member
                    exclude_unset=True, exclude_none=True
                )
                # Model is serialized as a dict[str, list] or list[dict]
                if (
                    (
                        isinstance(res_dict, dict)

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Pass `country='USA'` (ISO3) alongside the symbol.
  2. Or supply the country as a dimension: `dimension_values=['COUNTRY:USA']`.
  3. Check the exact dimension ID against the dataflow's structure if using REF_AREA/JURISDICTION variants.

Example fix

# before
res = obb.economy.economic_indicators(provider='imf', symbol='IFS::NGDP_XDC')

# after
res = obb.economy.economic_indicators(provider='imf', symbol='IFS::NGDP_XDC', country='USA')
Defensive patterns

Strategy: validation

Validate before calling

COUNTRY_DIMS = {'COUNTRY', 'REF_AREA', 'JURISDICTION', 'AREA'}

def has_country_source(country, dimension_values) -> bool:
    if country:
        return True
    if not dimension_values:
        return False
    return any(str(d).split(':', 1)[0].strip().upper() in COUNTRY_DIMS for d in dimension_values)

if not has_country_source(country, dimension_values):
    raise ValueError("Provide country='USA' or dimension_values=['COUNTRY:USA'].")

Type guard

COUNTRY_DIMS = {'COUNTRY', 'REF_AREA', 'JURISDICTION', 'AREA'}

def is_country_dimension_value(dv: str) -> bool:
    return str(dv).split(':', 1)[0].strip().upper() in COUNTRY_DIMS

Prevention

When it happens

Trigger: Calling the endpoint with a symbol but neither `country` nor country-bearing `dimension_values`, e.g. `symbol='IFS::NGDP_XDC'` alone. Also when `dimension_values=['INDICATOR:NGDP_XDC']` is passed — INDICATOR is not a country dimension, so nothing sets country.

Common situations: Coming from other providers where country is optional or defaulted to 'US'; passing dimension_values with wrong dimension IDs (e.g. lowercase 'country:USA' — note IDs are uppercased during parsing so this actually works, but typos like 'CONTRY' don't); assuming the symbol itself encodes the country.

Related errors


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