OpenBB-finance/OpenBB · warning · OpenBBError
The request was returned empty. This may be due to an invali
Error message
The request was returned empty. This may be due to an invalid, or incorrectly mapped, portfolio choice.
What it means
Thrown by FamaFrenchInternationalIndexReturns.transform_data when the zip archive downloaded from the Fama/French library contained no parseable DataFrames for the requested international index or country portfolio. The fetcher returned an empty list, so transform refuses to continue. It is an OpenBBError wrapping a plain empty-result condition, not a network failure.
Source
Thrown at openbb_platform/providers/famafrench/openbb_famafrench/models/international_index_returns.py:250
),
)
except Exception as e: # pylint: disable=broad-except
raise OpenBBError(e) from e
@staticmethod
def transform_data(
query: FamaFrenchInternationalIndexReturnsQueryParams,
data: tuple,
**kwargs: Any,
) -> AnnotatedResult[list[FamaFrenchInternationalIndexReturnsData]]:
"""Transform the extracted data."""
# pylint: disable=import-outside-toplevel
from pandas import MultiIndex
dfs, meta = data
if not dfs:
raise OpenBBError(
"The request was returned empty."
+ " This may be due to an invalid, or incorrectly mapped, portfolio choice."
)
returns_data = dfs[0] if isinstance(dfs, list) else dfs
# Values of -99.99 or -999 indicate no data,
# Drop columns that have no data.
for col in returns_data.columns:
if all(returns_data[col].values == "-99.99") or all(
returns_data[col].values == "-999"
):
returns_data = returns_data.drop(columns=[col])
else:
returns_data[col] = (
returns_data[col].astype(int)
if query.measure == "ratios" and col == "firms"
else returns_data[col].astype(float)
)View on GitHub (pinned to 3e071fcc2c)
Solutions
- Retry with a well-known index/country (e.g. 'Developed', 'Japan') to confirm the endpoint works at all.
- Verify the index value against INTERNATIONAL_INDEX_PORTFOLIO_FILES / COUNTRY_PORTFOLIO_FILES keys in openbb_famafrench/utils/helpers.py.
- Download the underlying zip directly from the Fama/French international portfolios URL and inspect its contents to see whether the dataset is empty upstream.
- If upstream changed format, open an issue/PR against the openbb_famafrench provider.
Defensive patterns
Strategy: try-catch
Try / catch
from openbb_core.provider.standard_errors import EmptyDataError
try:
res = obb.economy.famafrench.international_index_returns(country='Japan')
except EmptyDataError:
res = None
except OpenBBError as e:
if 'returned empty' in str(e):
res = None
else:
raise Prevention
- Validate index/country against INTERNATIONAL_INDEX_PORTFOLIO_FILES / COUNTRY_PORTFOLIO_FILES before calling.
- Treat empty results as a normal outcome and cache successful responses to reduce refetches.
When it happens
Trigger: Calling obb.economy.famafrench.international_index_returns (international portfolios endpoint) with an index/country whose dataset is valid enough to download but whose .dat tables yield zero DataFrames after processing, or when the source zip is empty/restructured.
Common situations: Passing a portfolio label that maps to a file the upstream site no longer populates; upstream Fama/French data layout changes breaking process_international_portfolio_data; requesting a dataset whose tables are all dropped as no-data (-99.99/-999 sentinel) columns.
Related errors
- The data is unexpectedly empty. -> {query.breakpoint_type}
- The request was returned empty. This may be due to an invali
- The request was returned empty. This may be due to an invali
- The request was returned empty. This may be due to an invali
- OBBject Extension Error -> An OBBject extension that acts
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/ac79edb4e15bbc1c.
Report an issue: GitHub.