OpenBB-finance/OpenBB · warning · ValueError

No presentation hierarchies found for dataflow '{dataflow_id

Error message

No presentation hierarchies found for dataflow '{dataflow_id}'

What it means

Raised by the hierarchy-table builder (get_dataflow_hierarchy_table) when get_dataflow_hierarchies returns an empty list: the dataflow exists but no presentation hierarchies were found — neither in hierarchy.json-derived structures nor in codelist-based presentations for its DSD. This is a data-availability condition, not a network error.

Source

Thrown at openbb_platform/providers/imf/openbb_imf/utils/metadata.py:1455

        Handles both hierarchy-based (hierarchy.json) and embedded presentations.

        Parameters
        ----------
        dataflow_id : str
            The dataflow ID
        table_id : str | None
            The specific hierarchy/table ID. If None, uses the first available.

        Returns
        -------
        dict
            Structure with hierarchy metadata and nested indicators.
        """
        available_hierarchies = self.get_dataflow_hierarchies(dataflow_id)

        if not available_hierarchies:
            raise ValueError(
                f"No presentation hierarchies found for dataflow '{dataflow_id}'"
            )

        # Track if this is a split table (one top-level code from a multi-code hierarchy)
        top_level_code_filter: str | None = None
        base_hierarchy_id: str | None = None

        if table_id:
            # Find the specific table
            selected_table = None
            for h in available_hierarchies:
                if h["id"] == table_id:
                    selected_table = h
                    break
            if not selected_table:
                raise ValueError(
                    f"Hierarchy '{table_id}' not found. "
                    f"Available: {[h['id'] for h in available_hierarchies]}"

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Call get_dataflow_hierarchies(dataflow_id) first and fall back to the flat indicator list (get_indicators_in) when it is empty.
  2. Refresh hierarchy metadata caches if you expect hierarchies to exist for this flow.
  3. Skip the dataflow in batch jobs and log it as 'no hierarchy'.

Example fix

# before
table = meta.get_dataflow_hierarchy_table('IRFCL', table_id=None)

# after
hierarchies = meta.get_dataflow_hierarchies('IRFCL')
if hierarchies:
    table = meta.get_dataflow_hierarchy_table('IRFCL', table_id=None)
else:
    table = {'indicators': meta.get_indicators_in('IRFCL')}
Defensive patterns

Strategy: fallback

Validate before calling

hierarchies = meta.get_dataflow_hierarchies(dataflow_id)
use_table = bool(hierarchies)

Try / catch

try:
    table = meta.get_dataflow_hierarchy_table(df_id, table_id)
except ValueError as e:
    if 'No presentation hierarchies' in str(e):
        table = {'indicators': meta.get_indicators_in(df_id)}  # flat fallback
    else:
        raise

Prevention

When it happens

Trigger: Requesting a hierarchy table for a flat dataflow that has no hierarchy definitions (no matching entry in self.hierarchies or _hierarchy_to_codelist_map); hierarchies cache not loaded for that DSD.

Common situations: Small/specialty dataflows (single-dimension aggregates) that genuinely have no presentation hierarchy; stale or partial hierarchy.json cache after an IMF restructure.

Related errors


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