{"record":{"id":"e78df7239db7eb64","repo":"OpenBB-finance/OpenBB","slug":"table-indicators-could-not-be-mapped-to-dimension","errorCode":null,"errorMessage":"Table indicators could not be mapped to dimension(s) {unmapped_indicator_dims}. The hierarchy's indicator codes are not compatible with dataflow '{dataflow}'. Hierarchy had codes from codelists: {list(codelist_to_dimension_cache.keys())}, but none matched the dataflow's indicator dimension.","messagePattern":"Table indicators could not be mapped to dimension\\(s\\) (.+?)\\. The hierarchy's indicator codes are not compatible with dataflow '(.+?)'\\. Hierarchy had codes from codelists: (.+?), but none matched the dataflow's indicator dimension\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/utils/table_builder.py","lineNumber":670,"sourceCode":"                        )\n\n            # If ALL indicator dimensions had zero matches, the hierarchy doesn't apply\n            indicator_dims_set = {\"INDICATOR\", \"BOP_ACCOUNTING_ENTRY\", \"SERIES\", \"ITEM\"}\n            missing_indicator_dims = [\n                d for d in empty_dimensions if d in indicator_dims_set\n            ]\n            expected_indicator_dims = [\n                d for d in dims_in_order if d in indicator_dims_set\n            ]\n            unmapped_indicator_dims = [\n                d\n                for d in expected_indicator_dims\n                if d not in dimension_codes and d not in fetch_kwargs\n            ]\n            if unmapped_indicator_dims:\n                # The hierarchy's indicator codes couldn't be mapped\n                # this table doesn't work for this dataflow\n                raise ValueError(\n                    f\"Table indicators could not be mapped to dimension(s) {unmapped_indicator_dims}. \"\n                    f\"The hierarchy's indicator codes are not compatible with dataflow '{dataflow}'. \"\n                    f\"Hierarchy had codes from codelists: {list(codelist_to_dimension_cache.keys())}, \"\n                    f\"but none matched the dataflow's indicator dimension.\"\n                )\n\n            if missing_indicator_dims and not any(\n                d in fetch_kwargs for d in indicator_dims_set\n            ):\n                # Use the same error format as query_builder validation\n                for dim_id in missing_indicator_dims:\n                    invalid_values = dimension_codes.get(dim_id, [])\n                    # Get available values for this dimension\n                    available_options = builder.get_options_for_dimension(dim_id)\n                    available_values = sorted(  # type: ignore\n                        {opt[\"value\"] for opt in available_options}\n                    )\n                    # Build prior selections dict","sourceCodeStart":652,"sourceCodeEnd":688,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/utils/table_builder.py#L652-L688","documentation":"Indicates a structural incompatibility: the indicator hierarchy loaded for a table carries codes from codelists (named in the message) that do not correspond to any indicator dimension (INDICATOR, BOP_ACCOUNTING_ENTRY, SERIES, ITEM) of the requested dataflow. The provider refuses to build the query rather than silently fetching wrong data.","triggerScenarios":"Using a table/hierarchy designed for one IMF dataflow against another (e.g. a BOP hierarchy against the IFS dataflow), or after IMF renames codelists so the codelist_to_dimension cache maps to nothing. Detected by comparing expected indicator dims in dims_in_order against dimension_codes and fetch_kwargs.","commonSituations":"Hardcoding a table/database name in scripts that IMF later restructures; version skew between cached hierarchy JSON and current dataflow definitions; mixing parameters from documentation of a different dataset.","solutions":["Use the correct dataflow for the table you are querying (check the dataflow name and table ID in IMF SDMX registry).","Update the openbb-imf provider so its hierarchy-to-dimension mapping matches current IMF structures.","Clear cached hierarchy/codelist files so they are rebuilt against the live dataflow.","If the mapping should work, file an upstream issue including the dataflow name and the codelist names from the error."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Verify the table's codelists overlap the dataflow's indicator dimension before fetching\nfrom openbb import obb\nflows = obb.economy.imf.dataflows()  # inspect valid dataflow ids\nassert my_dataflow in {f.dataflow for f in flows.results}, 'unknown/mismatched dataflow'","typeGuard":null,"tryCatchPattern":"try:\n    res = obb.economy.imf.fetch(dataset=dataflow, parameters=params)\nexcept ValueError as e:\n    if 'not compatible with dataflow' in str(e):\n        # structural mismatch: switch dataflow or table, do not retry unchanged\n        raise ConfigError(f'{table} incompatible with {dataflow}') from e\n    raise","preventionTips":["Never hardcode table IDs; resolve them from current dataflow metadata","Keep dataset/table pairs in one config object so they stay consistent","Version-pin openbb-imf after validating a table/dataflow mapping"],"tags":["imf","sdmx","dataflow-mismatch","valueerror"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}