OpenBB-finance/OpenBB · error · ValueError

Cannot mix tables and indicators in the same request. Got ta

Error message

Cannot mix tables and indicators in the same request. Got tables: {tables} and indicators: {[f'{d}::{c}' for d, c in indicators]}

What it means

Error "Cannot mix tables and indicators in the same request. Got tables: {tables} and indicators: {[f'{d}::{c}' for d, c in indicators]}" thrown in OpenBB-finance/OpenBB.

Source

Thrown at openbb_platform/providers/imf/openbb_imf/models/economic_indicators.py:365

            if identifier.startswith("H_"):
                is_table = True
            else:
                metadata = ImfMetadata()
                try:
                    hierarchies = metadata.get_dataflow_hierarchies(dataflow)
                    hierarchy_ids = {h.get("id") for h in hierarchies}
                    if identifier in hierarchy_ids:
                        is_table = True
                except Exception:  # noqa
                    pass  # If we can't check, assume it's an indicator

            if is_table:
                tables.append(sym)
            else:
                indicators.append((dataflow, identifier))

        if tables and indicators:
            raise ValueError(
                "Cannot mix tables and indicators in the same request. "
                f"Got tables: {tables} and indicators: {[f'{d}::{c}' for d, c in indicators]}"
            )

        if len(tables) > 1:
            raise ValueError(
                f"Only one table can be requested at a time. Got: {tables}"
            )

        if tables:
            self._is_table = True
            parts = tables[0].split("::", 1)
            self._dataflow = parts[0].upper()
            self._table_id = parts[1]
        else:
            self._is_table = False
            indicators_by_df: dict[str, list[str]] = {}

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Request either tables or indicators in a single call, not both.
  2. Split the request into separate calls for tables and indicators.

When it happens

Trigger: Thrown at openbb_platform/providers/imf/openbb_imf/models/economic_indicators.py:365 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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