{"record":{"id":"6f2028fb7f72dd08","repo":"OpenBB-finance/OpenBB","slug":"could-not-find-an-indicator-like-dimension-for-dat","errorCode":null,"errorMessage":"Could not find an indicator-like dimension for dataflow '{dataflow_id}'.","messagePattern":"Could not find an indicator-like dimension for dataflow '(.+?)'\\.","errorType":"exception","errorClass":"KeyError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/imf/openbb_imf/utils/metadata.py","lineNumber":918,"sourceCode":"                    activity_codelist_id, {}\n                )\n                for code_id, code_name in codes_map.items():\n                    series_id = f\"{dataflow_id}::{code_id}\"\n                    entry = {\n                        \"dataflow_id\": dataflow_id,\n                        \"dataflow_name\": dataflow_name,\n                        \"structure_id\": structure_id,\n                        \"agency_id\": agency_id,\n                        \"dimension_id\": \"ACTIVITY\",\n                        \"indicator\": code_id,\n                        \"label\": code_name,\n                        \"description\": descriptions_map.get(code_id, \"\"),\n                        \"series_id\": series_id,\n                    }\n                    full_indicator_list.append(entry)\n\n        if not full_indicator_list:\n            raise KeyError(\n                f\"Could not find an indicator-like dimension for dataflow '{dataflow_id}'.\"\n            )\n\n        return full_indicator_list\n\n    def _resolve_codelist_id(\n        self, dataflow_id: str, dsd_id: str | None, dim_id: str, dim_meta: dict\n    ) -> str | None:\n        if not dim_id:\n            return None\n\n        # Check for explicit codelist reference first\n        representation = dim_meta.get(\"representation\", {})\n        codelist_ref = representation.get(\"codelist\")\n        if isinstance(codelist_ref, dict):\n            return codelist_ref.get(\"id\")\n        if isinstance(codelist_ref, str):\n            return codelist_ref","sourceCodeStart":900,"sourceCodeEnd":936,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/utils/metadata.py#L900-L936","documentation":"Raised as a KeyError by get_indicators_in when the DSD parsed successfully but no dimension qualified as 'indicator-like' (e.g. no ACTIVITY-style dimension with codes), so full_indicator_list stayed empty. It indicates a structural mismatch between the dataflow's dimensions and the heuristics this utility uses to identify indicator dimensions.","triggerScenarios":"Dataflows whose dimensions are only frequency/region/time-style codes with no indicator codelist; codelist resolution failing for every candidate dimension (see _resolve_codelist_id); new dataflows published with an unfamiliar dimension layout.","commonSituations":"Exploratory scripts that iterate over every dataflow in the catalog and hit one with an unsupported layout; upstream IMF schema changes introducing new dataflow shapes; partial parameter-API responses swallowed by the 'except Exception' around get_dataflow_parameters.","solutions":["Catch KeyError for this dataflow and skip it when iterating the full catalog — not every dataflow has indicators.","Check the dataflow's dimension list (meta.datastructures[dsd_id]['dimensions']) to confirm no indicator dimension exists.","Report/patch the heuristic in metadata.py if a legitimate indicator dimension (different id than ACTIVITY) is being missed."],"exampleFix":"# before\nfor df_id in meta.dataflows:\n    indicators = meta.get_indicators_in(df_id)  # KeyError on layout-less dataflows\n\n# after\nfor df_id in meta.dataflows:\n    try:\n        indicators = meta.get_indicators_in(df_id)\n    except KeyError:\n        continue  # dataflow has no indicator-like dimension","handlingStrategy":"fallback","validationCode":"def likely_has_indicators(meta, df_id: str) -> bool:\n    ref = meta.dataflows.get(df_id, {}).get('structureRef', {})\n    dsd = meta.datastructures.get(ref.get('id', ''), {})\n    return len(dsd.get('dimensions', [])) > 1  # heuristic: flat flows rarely expose indicators","typeGuard":null,"tryCatchPattern":"try:\n    indicators = meta.get_indicators_in(df_id)\nexcept KeyError:\n    indicators = []  # dataflow layout unsupported: degrade gracefully in catalog crawls","preventionTips":["When iterating all dataflows, treat KeyError as 'skip' by design.","Pin provider versions whose indicator heuristics match the IMF layout you depend on."],"tags":["imf","sdmx","metadata","indicators","dataflow"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}