OpenBB-finance/OpenBB · error · OpenBBError
An unexpected error occurred: {ex}
Error message
An unexpected error occurred: {ex} What it means
Raised by the economic-indicators model validator when more than one table symbol is present in the request. Table mode is hard-wired for a single dataflow/table (`tables[0]` is used exclusively), so a second table would be silently dropped if allowed — the validator rejects instead.
Source
Thrown at openbb_platform/core/openbb_core/app/model/obbject.py:283
if sort_by:
df.sort_values(
by=sort_by,
ascending=ascending if ascending is not None else True,
inplace=True,
)
except OpenBBError as e:
raise e
except ValueError as ve:
raise OpenBBError(
f"ValueError: {ve}. Ensure the data format matches the expected format."
) from ve
except TypeError as te:
raise OpenBBError(
f"TypeError: {te}. Check the data types in your results."
) from te
except Exception as ex:
raise OpenBBError(f"An unexpected error occurred: {ex}") from ex
return df
def to_polars(self) -> "PolarsDataFrame": # type: ignore
"""Convert results field to polars dataframe."""
try:
from polars import from_pandas # type: ignore # pylint: disable=import-outside-toplevel
except ImportError as exc:
raise ImportError(
"Please install polars: `pip install polars pyarrow` to use this method."
) from exc
return from_pandas(self.to_dataframe(index=None))
def to_numpy(self) -> "ndarray":
"""Convert results field to numpy array."""
return self.to_dataframe(index=None).to_numpy()
View on GitHub (pinned to 3e071fcc2c)
Solutions
- Issue one request per table and concatenate results client-side.
- For many tables, loop over `PRESENTATION_TABLES`/list_tables() entries sequentially.
- If you need multiple indicators (not tables) in one call, use plain indicator symbols together — that is supported.
Example fix
# before res = obb.economy.economic_indicators(provider='imf', symbol='STA::H_CPI,STA::H_PCH', country='USA') # after results = [obb.economy.economic_indicators(provider='imf', symbol=s, country='USA') for s in ['STA::H_CPI', 'STA::H_PCH']]
Defensive patterns
Strategy: validation
Validate before calling
def validate_single_table(symbol: str) -> str:
tables = [s.strip() for s in symbol.split(',') if s.strip().split('::', 1)[-1].startswith('H_')]
if len(tables) > 1:
raise ValueError(f'Only one table per request; got {tables}. Split into separate calls.')
return symbol Type guard
def is_single_table_request(symbol: str) -> bool:
tables = [s for s in symbol.split(',') if s.strip().split('::', 1)[-1].startswith('H_')]
return len(tables) <= 1 Prevention
- Loop over tables one request at a time and merge results client-side.
- Remember multiple plain indicators in one request ARE supported — the one-per-request rule applies to tables only.
When it happens
Trigger: `symbol='STA::H_CPI,STA::H_PCH'` (two H_ tables), or two hierarchy IDs from the same/different dataflows. Mixing one table with indicators hits the sibling error instead.
Common situations: Iterating over 'all presentation tables' in one call; user multi-select of tables in a UI; assuming tables batch like indicators do.
Related errors
- TypeError: {te}. Check the data types in your results.
- OBBject Extension Error -> An OBBject extension that modif
- Unsupported data format.
- ValueError: {ve}. Ensure the data format matches the expecte
- At least one extension type must be selected.
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/3622f8d5182d991d.
Report an issue: GitHub.