OpenBB-finance/OpenBB · error · ValueError

Dataflow mismatch: provided '{dataflow}' but table_id specif

Error message

Dataflow mismatch: provided '{dataflow}' but table_id specifies '{parsed_dataflow}'. Use one or the other.

What it means

ImfTableBuilder.get_table raises ValueError when both dataflow and a 'dataflow_id::table_id' formatted table_id are supplied and the dataflow parts disagree. The library refuses to guess which one you meant.

Source

Thrown at openbb_platform/providers/imf/openbb_imf/utils/table_builder.py:165

        >>> result = tb.get_table("IRFCL", indicators=["A", "FA", "L"], COUNTRY="US")

        >>> # Combine depth with parent to drill down
        >>> result = tb.get_table("BOP", parent_id="NETCD_T", depth=1, COUNTRY="US")

        >>> # Use combined dataflow::table_id format from list_tables choices
        >>> result = tb.get_table(table_id="BOP::H_BOP_BOP_AGG_STANDARD_PRESENTATION", COUNTRY="USA", FREQUENCY="A")
        """
        # pylint: disable=import-outside-toplevel
        from openbb_imf.utils.progressive_helper import ImfParamsBuilder

        # Parse dataflow_id::table_id format if provided
        if table_id and "::" in table_id:
            parts = table_id.split("::", 1)
            parsed_dataflow = parts[0]
            parsed_table_id = parts[1]
            # If dataflow was also provided, validate it matches
            if dataflow is not None and dataflow != parsed_dataflow:
                raise ValueError(
                    f"Dataflow mismatch: provided '{dataflow}' but table_id "
                    f"specifies '{parsed_dataflow}'. Use one or the other."
                )
            dataflow = parsed_dataflow
            table_id = parsed_table_id

        if dataflow is None:
            raise ValueError(
                "dataflow is required. Either provide it directly or use "
                "table_id in 'dataflow_id::table_id' format."
            )

        # Validate parameter combinations using progressive helper
        if kwargs or start_date or end_date:
            self._validate_dimension_constraints(
                dataflow, start_date=start_date, end_date=end_date, **kwargs
            )

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Provide only table_id='DATAFLOW::TABLE' and drop the dataflow kwarg.
  2. Or pass a bare table_id plus the matching dataflow, keeping the two consistent.
  3. In templated code, derive one from the other instead of setting both.

Example fix

# before
result = tb.get_table(dataflow='BOP', table_id='BOP_DOTS::H_BOP_DOTS')

# after
result = tb.get_table(table_id='BOP_DOTS::H_BOP_DOTS')
Defensive patterns

Strategy: validation

Validate before calling

def normalize_table_args(dataflow: str | None, table_id: str | None):
    if table_id and '::' in table_id:
        parsed_flow, tid = table_id.split('::', 1)
        if dataflow is not None and dataflow != parsed_flow:
            raise ValueError(f'conflicting dataflows: {dataflow} vs {parsed_flow}')
        return parsed_flow, tid
    if dataflow is None:
        raise ValueError('dataflow required')
    return dataflow, table_id

Try / catch

try:
    result = tb.get_table(dataflow=dataflow, table_id=table_id)
except ValueError as e:
    if 'Dataflow mismatch' in str(e):
        result = tb.get_table(table_id=table_id)  # let table_id win
    else:
        raise

Prevention

When it happens

Trigger: get_table(dataflow='BOP', table_id='BOP_DOTS::H_BOP_DOTS') — the explicit dataflow does not match the prefix parsed from table_id.

Common situations: Config files or notebooks that evolved: table_id was later enriched with the prefixed format while the old dataflow kwarg remained, or copy-paste mixing two dataflows.

Related errors


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