{"record":{"id":"02a51575db16b2d0","repo":"OpenBB-finance/OpenBB","slug":"no-valid-indicator-codes-found-after-filtering-and","errorCode":null,"errorMessage":"No valid indicator codes found after filtering and dimension mapping. Filtered entries: {len(entries_with_codes)}","messagePattern":"No valid indicator codes found after filtering and dimension mapping\\. Filtered entries: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/utils/table_builder.py","lineNumber":337,"sourceCode":"\n                if not dimension_id:\n                    warnings.warn(\n                        f\"Could not map codelist {codelist_id} to dimension for dataflow {dataflow}\",\n                        OpenBBWarning,\n                    )\n                    continue\n\n            # Add code to the appropriate dimension\n            if indicator_code not in dimension_codes[dimension_id]:\n                dimension_codes[dimension_id].append(indicator_code)\n                # Track depth for constraint URL length optimization\n                code_depth = entry.get(\"depth\", 0)\n                dimension_codes_with_depth[dimension_id].append(\n                    (indicator_code, code_depth)\n                )\n\n        if not dimension_codes:\n            raise ValueError(\n                f\"No valid indicator codes found after filtering and dimension mapping. \"\n                f\"Filtered entries: {len(entries_with_codes)}\"\n            )\n\n        hierarchy_order_map = {}\n        hierarchy_by_series_id = {}\n        hierarchy_by_sorted_codes = {}\n        # Some hierarchies can legitimately contain multiple nodes with the same\n        # (indicator_code, parent_code) (e.g., BOP Credit vs Debit variants under a Net parent),\n        # so store a list and disambiguate later.\n        # Key: (indicator_code, parent_code) e.g., (\"O\", \"A_P\") vs (\"O\", \"L_P\")\n        hierarchy_by_composite_key: dict[tuple[str, str], list[dict]] = defaultdict(\n            list\n        )\n        parents_by_indicator_code: dict[str, set[str]] = defaultdict(set)\n\n        # Build indicator_by_code lookup for depth calculation\n        indicator_by_code = {}","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/utils/table_builder.py#L319-L355","documentation":"Thrown by the IMF SDMX table builder when, after walking the indicator hierarchy and filtering entries against codelist/dimension mappings, not a single indicator code could be assigned to any dimension. It means the fetched hierarchy contained entries, but none survived filtering (wrong codelist, unmapped codes, or depth filtering), so no data URL can be constructed.","triggerScenarios":"Calling an IMF dataflow fetch (e.g. economic/imf fetch with a table/hierarchy-driven dataflow) where the hierarchy file's indicator codes do not map onto any dimension of the dataflow, or all entries lack usable indicator codes after codelist filtering. Occurs inside build_fetch_kwargs/table construction before any HTTP data request is finalized.","commonSituations":"IMF changes or renames SDMX codelists; the cached hierarchy is stale; user supplies a table whose indicators belong to a different dataflow; upstream dimension-mapping cache (codelist_to_dimension) is empty because a prior metadata request failed silently.","solutions":["Update/refresh the IMF provider package so hierarchy parsing matches current IMF codelists (pip install -U openbb-imf).","Clear any cached IMF hierarchy/codelist data so fresh metadata is fetched and re-mapped.","Verify you are querying the correct dataflow/table combination for the indicators you want (e.g. BOP vs IFS tables).","If it persists, inspect openbb_imf/utils/table_builder.py dimension mapping for the specific dataflow and report the dataflow + table ID as an upstream bug."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Before fetching, confirm the table's hierarchy yields mappable indicator codes\nfrom openbb import obb\ncodelists = obb.economy.imf.codelists(dataset='BOP')  # discover current mapping\nif not codelists.results:\n    raise RuntimeError('IMF codelist metadata unavailable - do not fetch; ' \n                       'this is the precondition that produces the 'No valid indicator codes' error')","typeGuard":null,"tryCatchPattern":"try:\n    res = obb.economy.imf.fetch(dataset='...', parameters={...})\nexcept ValueError as e:\n    if 'No valid indicator codes found' in str(e):\n        # metadata/hierarchy problem, not user input - refresh caches, then retry once\n        obb.economy.imf.slash_refresh_cache() if hasattr(obb.economy.imf, 'slash_refresh_cache') else None\n    raise","preventionTips":["Refresh IMF metadata/codelists before batch jobs","Pin an openbb-imf version validated against current IMF SDMX structures","Log the dataflow + table ID with every fetch so failures are reproducible"],"tags":["imf","sdmx","data-mapping","valueerror"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}