{"record":{"id":"46106cf9166fdcd5","repo":"OpenBB-finance/OpenBB","slug":"dataflow-dataflow-id-not-found","errorCode":null,"errorMessage":"Dataflow '{dataflow_id}' not found.","messagePattern":"Dataflow '(.+?)' not found\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/utils/metadata.py","lineNumber":394,"sourceCode":"                    break\n\n            if include:\n                filtered_results.append(indicator)\n\n        # Clean up internal search field before returning\n        for indicator in filtered_results:\n            indicator.pop(\"_table_search_text\", None)\n\n        return filtered_results\n\n    def _parse_query(self, query: str) -> list[list[str]]:\n        \"\"\"Parse a search query string into OR-groups of AND-terms.\"\"\"\n        return parse_search_query(query)\n\n    def get_dataflow_parameters(self, dataflow_id: str) -> dict[str, list[dict]]:\n        \"\"\"Get available parameters for a given dataflow.\"\"\"\n        if dataflow_id not in self.dataflows:\n            raise ValueError(f\"Dataflow '{dataflow_id}' not found.\")\n\n        if (\n            hasattr(self, \"_dataflow_parameters_cache\")\n            and dataflow_id in self._dataflow_parameters_cache\n        ):\n            return self._dataflow_parameters_cache[dataflow_id]\n\n        df_obj = self.dataflows[dataflow_id]\n        agency_id = df_obj.get(\"agencyID\")\n        dsd_id = df_obj.get(\"structureRef\", {}).get(\"id\")\n        dsd = self.datastructures.get(dsd_id, {})\n        if not dsd:\n            return {}\n\n        dimensions_metadata = {\n            dim[\"id\"]: dim for dim in dsd.get(\"dimensions\", []) if dim.get(\"id\")\n        }\n","sourceCodeStart":376,"sourceCodeEnd":412,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/utils/metadata.py#L376-L412","documentation":"Raised by get_dataflow_parameters when the requested dataflow_id is not a key in the loaded dataflows catalog. This method backs the query builders (e.g. IMTS parameter lookup in dot_helpers) and needs the dataflow's DSD to enumerate dimension values, so an unknown ID fails immediately with the offending ID echoed.","triggerScenarios":"get_dataflow_parameters('IMT') (typo), lowercase 'imts' where the catalog keys are uppercase, or an ID from a different agency/version that the loaded catalog does not contain.","commonSituations":"Hard-coded dataflow IDs that bit-rot after IMF catalog revisions; case-sensitive lookups after user input normalization; partially loaded metadata after a network failure during initialization.","solutions":["Check the exact ID via list(meta.dataflows.keys()) or search_dataflows and use it verbatim.","Normalize IDs to the catalog's casing (typically upper-case) before calling.","If the catalog is empty or stale, rebuild the metadata object / update openbb-imf so the catalog refreshes."],"exampleFix":"# before\nparams = meta.get_dataflow_parameters('imts')\n\n# after\ndf_id = next(d for d in meta.dataflows if d.upper() == 'IMTS')\nparams = meta.get_dataflow_parameters(df_id)","handlingStrategy":"validation","validationCode":"df_id = df_id.strip().upper()\nif df_id not in meta.dataflows:\n    raise ValueError(f'Unknown dataflow {df_id!r}. Valid: {sorted(meta.dataflows)[:10]} ...')\nparams = meta.get_dataflow_parameters(df_id)","typeGuard":"def is_known_dataflow(df_id: str | None, catalog: dict) -> bool:\n    return isinstance(df_id, str) and df_id in catalog","tryCatchPattern":"try:\n    params = meta.get_dataflow_parameters(df_id)\nexcept ValueError as e:\n    if 'not found' in str(e):\n        df_id = next(d for d in meta.dataflows if df_id.upper() in d.upper())\n        params = meta.get_dataflow_parameters(df_id)\n    else:\n        raise","preventionTips":["Look up IDs from meta.dataflows.keys() once and cache them.","Treat dataflow IDs as case-sensitive exact strings.","Refresh the catalog when IMF revises the registry."],"tags":["validation","imf","metadata","dataflow-id","sdmx"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}