{"record":{"id":"71f13a96fbf849a0","repo":"OpenBB-finance/OpenBB","slug":"no-indicators-match-the-specified-filters-depth","errorCode":null,"errorMessage":"No indicators match the specified filters (depth={depth}, parent_id={parent_id}, indicators={indicators}). Total entries in hierarchy: {len(table_structure['indicators'])}","messagePattern":"No indicators match the specified filters \\(depth=(.+?), parent_id=(.+?), indicators=(.+?)\\)\\. Total entries in hierarchy: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/utils/table_builder.py","lineNumber":239,"sourceCode":"                entry\n                for entry in filtered_hierarchy_entries\n                if entry.get(\"parent_id\") == parent_id\n            ]\n        elif depth is not None:\n            # Filter by depth\n            filtered_hierarchy_entries = [\n                entry\n                for entry in filtered_hierarchy_entries\n                if entry.get(\"depth\") == depth\n            ]\n\n        # Extract entries with actual indicator codes (skip pure groups with no code)\n        entries_with_codes = [\n            entry for entry in filtered_hierarchy_entries if entry.get(\"indicator_code\")\n        ]\n\n        if not entries_with_codes:\n            raise ValueError(\n                \"No indicators match the specified filters \"\n                f\"(depth={depth}, parent_id={parent_id}, indicators={indicators}). \"\n                f\"Total entries in hierarchy: {len(table_structure['indicators'])}\"\n            )\n\n        dimension_codes: dict = defaultdict(list)\n        dimension_codes_with_depth = defaultdict(list)\n        codelist_to_dimension_cache = {}\n\n        for entry in entries_with_codes:\n            indicator_code = entry.get(\"indicator_code\")\n            code_urn = entry.get(\"code_urn\", \"\")\n\n            if not indicator_code:\n                continue\n\n            dimension_id = entry.get(\"dimension_id\")\n","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/utils/table_builder.py#L221-L257","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect table_structure['indicators'] and start from the root (no filters), adding one filter at a time.","Verify parent_id is the hierarchy node's code, not its human-readable label.","Check the depth value against actual entry depths in the structure.","Confirm indicator codes belong to this table's codelist."],"exampleFix":"# before\nresult = tb.get_table('BOP::T', parent_id='Trade Balance', depth=3)  # name, not code\n\n# after\nentries = table_structure['indicators']\nparent = next(e['id'] for e in entries if 'trade' in e.get('label','').lower())\nresult = tb.get_table('BOP::T', parent_id=parent, depth=3)","handlingStrategy":"validation","validationCode":"def filters_match_indicators(table_structure, depth=None, parent_id=None, indicators=None):\n    entries = table_structure['indicators']\n    if parent_id is not None:\n        entries = [e for e in entries if e.get('parent_id') == parent_id or e.get('parentId') == parent_id]\n    if depth is not None:\n        entries = [e for e in entries if e.get('depth') == depth]\n    if indicators:\n        entries = [e for e in entries if e.get('indicator_code') in set(indicators)]\n    return any(e.get('indicator_code') for e in entries)","typeGuard":"def entry_has_indicator_code(entry: dict) -> bool:\n    return isinstance(entry, dict) and bool(entry.get('indicator_code'))","tryCatchPattern":"try:\n    result = tb.get_table(flow_table, depth=depth, parent_id=parent_id)\nexcept ValueError as e:\n    if 'No indicators match' in str(e):\n        result = tb.get_table(flow_table, parent_id=None, depth=None)  # start wide, filter locally\n    else:\n        raise","preventionTips":["Inspect table_structure['indicators'] once and cache the tree; navigate by code, not label.","Apply one filter at a time when drilling hierarchies.","Remember group nodes without indicator_code are intentionally skipped."],"tags":["validation","imf","hierarchy","table-builder","filters"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}