{"record":{"id":"c7dec50f69e1d4a7","repo":"OpenBB-finance/OpenBB","slug":"dataflow-is-required-either-provide-it-directly-o","errorCode":null,"errorMessage":"dataflow is required. Either provide it directly or use table_id in 'dataflow_id::table_id' format.","messagePattern":"dataflow is required\\. Either provide it directly or use table_id in 'dataflow_id::table_id' format\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/utils/table_builder.py","lineNumber":173,"sourceCode":"        # pylint: disable=import-outside-toplevel\n        from openbb_imf.utils.progressive_helper import ImfParamsBuilder\n\n        # Parse dataflow_id::table_id format if provided\n        if table_id and \"::\" in table_id:\n            parts = table_id.split(\"::\", 1)\n            parsed_dataflow = parts[0]\n            parsed_table_id = parts[1]\n            # If dataflow was also provided, validate it matches\n            if dataflow is not None and dataflow != parsed_dataflow:\n                raise ValueError(\n                    f\"Dataflow mismatch: provided '{dataflow}' but table_id \"\n                    f\"specifies '{parsed_dataflow}'. Use one or the other.\"\n                )\n            dataflow = parsed_dataflow\n            table_id = parsed_table_id\n\n        if dataflow is None:\n            raise ValueError(\n                \"dataflow is required. Either provide it directly or use \"\n                \"table_id in 'dataflow_id::table_id' format.\"\n            )\n\n        # Validate parameter combinations using progressive helper\n        if kwargs or start_date or end_date:\n            self._validate_dimension_constraints(\n                dataflow, start_date=start_date, end_date=end_date, **kwargs\n            )\n\n        # If table_id not provided, auto-select if only one table available\n        if table_id is None:\n            available_tables = self.metadata.get_dataflow_hierarchies(dataflow)\n            if len(available_tables) == 1:\n                table_id = available_tables[0][\"id\"]\n            elif len(available_tables) == 0:\n                raise ValueError(\n                    f\"No tables/hierarchies found for dataflow '{dataflow}'\"","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/utils/table_builder.py#L155-L191","documentation":"get_table raises ValueError when no dataflow could be determined: neither dataflow was passed nor did table_id use the 'dataflow_id::table_id' format (which is the only way table_id alone carries the dataflow). Table lookup requires a dataflow context.","triggerScenarios":"get_table(table_id='H_BOP_BOP_AGG_STANDARD_PRESENTATION') without the 'BOP::' prefix and without dataflow='BOP'; or both arguments None.","commonSituations":"Copy-pasting a bare hierarchy/table name from the IMF portal, or assuming table names are globally unique across dataflows.","solutions":["Prefix the table: table_id='BOP::H_BOP_BOP_AGG_STANDARD_PRESENTATION'.","Or pass dataflow='BOP' alongside the bare table_id.","List valid dataflows via ImfQueryBuilder().metadata.dataflows to find the right prefix."],"exampleFix":"# before\nresult = tb.get_table(table_id='H_BOP_BOP_AGG_STANDARD_PRESENTATION')\n\n# after\nresult = tb.get_table(table_id='BOP::H_BOP_BOP_AGG_STANDARD_PRESENTATION')","handlingStrategy":"validation","validationCode":"def ensure_dataflow(dataflow: str | None, table_id: str | None) -> str:\n    if dataflow:\n        return dataflow\n    if table_id and '::' in table_id:\n        return table_id.split('::', 1)[0]\n    raise ValueError('dataflow required: use table_id=FLOW::TABLE or pass dataflow=')","typeGuard":null,"tryCatchPattern":"try:\n    result = tb.get_table(table_id=table_id)\nexcept ValueError as e:\n    if 'dataflow is required' in str(e) and table_id:\n        result = tb.get_table(table_id=f'{known_flow}::{table_id}')\n    else:\n        raise","preventionTips":["Copy table IDs including the 'DATAFLOW::' prefix from the IMF portal.","Validate inputs with ensure_dataflow-style helpers before calling get_table.","Keep a mapping of table names to their owning dataflow in your config."],"tags":["validation","imf","api-misuse","table-builder"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}