{"record":{"id":"6e0cb45aa4e3a586","repo":"OpenBB-finance/OpenBB","slug":"no-presentation-hierarchies-found-for-dataflow-d","errorCode":null,"errorMessage":"No presentation hierarchies found for dataflow '{dataflow_id}'","messagePattern":"No presentation hierarchies found for dataflow '(.+?)'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/imf/openbb_imf/utils/metadata.py","lineNumber":1455,"sourceCode":"\n        Handles both hierarchy-based (hierarchy.json) and embedded presentations.\n\n        Parameters\n        ----------\n        dataflow_id : str\n            The dataflow ID\n        table_id : str | None\n            The specific hierarchy/table ID. If None, uses the first available.\n\n        Returns\n        -------\n        dict\n            Structure with hierarchy metadata and nested indicators.\n        \"\"\"\n        available_hierarchies = self.get_dataflow_hierarchies(dataflow_id)\n\n        if not available_hierarchies:\n            raise ValueError(\n                f\"No presentation hierarchies found for dataflow '{dataflow_id}'\"\n            )\n\n        # Track if this is a split table (one top-level code from a multi-code hierarchy)\n        top_level_code_filter: str | None = None\n        base_hierarchy_id: str | None = None\n\n        if table_id:\n            # Find the specific table\n            selected_table = None\n            for h in available_hierarchies:\n                if h[\"id\"] == table_id:\n                    selected_table = h\n                    break\n            if not selected_table:\n                raise ValueError(\n                    f\"Hierarchy '{table_id}' not found. \"\n                    f\"Available: {[h['id'] for h in available_hierarchies]}\"","sourceCodeStart":1437,"sourceCodeEnd":1473,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/utils/metadata.py#L1437-L1473","documentation":"Raised by the hierarchy-table builder (get_dataflow_hierarchy_table) when get_dataflow_hierarchies returns an empty list: the dataflow exists but no presentation hierarchies were found — neither in hierarchy.json-derived structures nor in codelist-based presentations for its DSD. This is a data-availability condition, not a network error.","triggerScenarios":"Requesting a hierarchy table for a flat dataflow that has no hierarchy definitions (no matching entry in self.hierarchies or _hierarchy_to_codelist_map); hierarchies cache not loaded for that DSD.","commonSituations":"Small/specialty dataflows (single-dimension aggregates) that genuinely have no presentation hierarchy; stale or partial hierarchy.json cache after an IMF restructure.","solutions":["Call get_dataflow_hierarchies(dataflow_id) first and fall back to the flat indicator list (get_indicators_in) when it is empty.","Refresh hierarchy metadata caches if you expect hierarchies to exist for this flow.","Skip the dataflow in batch jobs and log it as 'no hierarchy'."],"exampleFix":"# before\ntable = meta.get_dataflow_hierarchy_table('IRFCL', table_id=None)\n\n# after\nhierarchies = meta.get_dataflow_hierarchies('IRFCL')\nif hierarchies:\n    table = meta.get_dataflow_hierarchy_table('IRFCL', table_id=None)\nelse:\n    table = {'indicators': meta.get_indicators_in('IRFCL')}","handlingStrategy":"fallback","validationCode":"hierarchies = meta.get_dataflow_hierarchies(dataflow_id)\nuse_table = bool(hierarchies)","typeGuard":null,"tryCatchPattern":"try:\n    table = meta.get_dataflow_hierarchy_table(df_id, table_id)\nexcept ValueError as e:\n    if 'No presentation hierarchies' in str(e):\n        table = {'indicators': meta.get_indicators_in(df_id)}  # flat fallback\n    else:\n        raise","preventionTips":["Check hierarchy availability once per dataflow and branch your UI/pipeline on it.","Log 'no hierarchy' flows separately from real errors during catalog sweeps."],"tags":["imf","sdmx","hierarchy","metadata","empty-data"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}