OpenBB-finance/OpenBB · error · ValueError

No indicators match the specified filters (depth={depth}, pa

Error message

No indicators match the specified filters (depth={depth}, parent_id={parent_id}, indicators={indicators}). Total entries in hierarchy: {len(table_structure['indicators'])}

What it means

After filtering the table hierarchy by depth, parent_id, and/or an indicators list, no entries carry an indicator_code (pure grouping nodes are skipped). ValueError reports the filters and total hierarchy size so you can tell whether the hierarchy is empty or your filters are too narrow.

Source

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

                entry
                for entry in filtered_hierarchy_entries
                if entry.get("parent_id") == parent_id
            ]
        elif depth is not None:
            # Filter by depth
            filtered_hierarchy_entries = [
                entry
                for entry in filtered_hierarchy_entries
                if entry.get("depth") == depth
            ]

        # Extract entries with actual indicator codes (skip pure groups with no code)
        entries_with_codes = [
            entry for entry in filtered_hierarchy_entries if entry.get("indicator_code")
        ]

        if not entries_with_codes:
            raise ValueError(
                "No indicators match the specified filters "
                f"(depth={depth}, parent_id={parent_id}, indicators={indicators}). "
                f"Total entries in hierarchy: {len(table_structure['indicators'])}"
            )

        dimension_codes: dict = defaultdict(list)
        dimension_codes_with_depth = defaultdict(list)
        codelist_to_dimension_cache = {}

        for entry in entries_with_codes:
            indicator_code = entry.get("indicator_code")
            code_urn = entry.get("code_urn", "")

            if not indicator_code:
                continue

            dimension_id = entry.get("dimension_id")

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Inspect table_structure['indicators'] and start from the root (no filters), adding one filter at a time.
  2. Verify parent_id is the hierarchy node's code, not its human-readable label.
  3. Check the depth value against actual entry depths in the structure.
  4. Confirm indicator codes belong to this table's codelist.

Example fix

# before
result = tb.get_table('BOP::T', parent_id='Trade Balance', depth=3)  # name, not code

# after
entries = table_structure['indicators']
parent = next(e['id'] for e in entries if 'trade' in e.get('label','').lower())
result = tb.get_table('BOP::T', parent_id=parent, depth=3)
Defensive patterns

Strategy: validation

Validate before calling

def filters_match_indicators(table_structure, depth=None, parent_id=None, indicators=None):
    entries = table_structure['indicators']
    if parent_id is not None:
        entries = [e for e in entries if e.get('parent_id') == parent_id or e.get('parentId') == parent_id]
    if depth is not None:
        entries = [e for e in entries if e.get('depth') == depth]
    if indicators:
        entries = [e for e in entries if e.get('indicator_code') in set(indicators)]
    return any(e.get('indicator_code') for e in entries)

Type guard

def entry_has_indicator_code(entry: dict) -> bool:
    return isinstance(entry, dict) and bool(entry.get('indicator_code'))

Try / catch

try:
    result = tb.get_table(flow_table, depth=depth, parent_id=parent_id)
except ValueError as e:
    if 'No indicators match' in str(e):
        result = tb.get_table(flow_table, parent_id=None, depth=None)  # start wide, filter locally
    else:
        raise

Prevention

When it happens

Trigger: parent_id pointing at a leaf/group with no coded children, depth filtering to a level that only contains group headers, or indicators codes that match nothing in this table.

Common situations: Drilling a hierarchy with a wrong parent_id (often a display name instead of the code), expecting every depth level to have codes, or indicator codes copied from a different table.

Related errors


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