{"record":{"id":"533cfde057a4c8dc","repo":"OpenBB-finance/OpenBB","slug":"obbject-extension-error-an-obbject-extension","errorCode":null,"errorMessage":"OBBject Extension Error -> \n\nAn OBBject extension that acts on command output is installed but has not been enabled in `system_settings.json`.\n\nSet `allow_on_command_output` to True to enable it.\nOr, set the environment variable `OPENBB_ALLOW_ON_COMMAND_OUTPUT` to True.\n\nProceed with caution as this may have security implications.\n\nEnsure the extension is installed from a trusted source.\n\n","messagePattern":"OBBject Extension Error -> \n\nAn OBBject extension that acts on command output is installed but has not been enabled in `system_settings\\.json`\\.\n\nSet `allow_on_command_output` to True to enable it\\.\nOr, set the environment variable `OPENBB_ALLOW_ON_COMMAND_OUTPUT` to True\\.\n\nProceed with caution as this may have security implications\\.\n\nEnsure the extension is installed from a trusted source\\.\n\n","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/core/openbb_core/app/model/extension.py","lineNumber":71,"sourceCode":"        self.results_only = results_only\n\n        # This must be explicitly enabled.\n        if self.on_command_output is False and (\n            self.command_output_paths\n            or self.results_only is True\n            or self.immutable is False\n        ):\n            raise ValueError(\n                \"OBBject Extension Error -> 'on_command_output' must be set as True when\"\n                + \" 'command_output_paths', 'results_only' or 'immutable' is set.\",\n            )\n\n        # The user must explicitly enable OBBject extensions that act on command output.\n        if (\n            self.on_command_output\n            and not SystemService().system_settings.allow_on_command_output\n        ):\n            raise RuntimeError(\n                \"OBBject Extension Error -> \\n\\n\"\n                + \"An OBBject extension that acts on command output is installed \"\n                + \"but has not been enabled in `system_settings.json`.\\n\\n\"\n                + \"Set `allow_on_command_output` to True to enable it.\\n\"\n                + \"Or, set the environment variable `OPENBB_ALLOW_ON_COMMAND_OUTPUT` to True.\"\n                + \"\\n\\nProceed with caution as this may have security implications.\\n\\n\"\n                + \"Ensure the extension is installed from a trusted source.\\n\\n\",\n            )\n\n        # The user must explicitly enable OBBject extensions that modify output.\n        if (\n            self.on_command_output\n            and self.immutable is False\n            and not SystemService().system_settings.allow_mutable_extensions\n        ):\n            raise RuntimeError(\n                \"OBBject Extension Error -> \\n\\n\"\n                + \"An OBBject extension that modifies the output is installed \"","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/core/openbb_core/app/model/extension.py#L53-L89","documentation":"Raised in the DOT fetcher's `transform_data` when the IMF response contains a `data` list that is empty. The request parsed and executed fine, but no trade records came back — typically a valid country pair with no published bilateral trade, or a date window outside coverage. Uses `EmptyDataError`, so OpenBB downstream handles it as 'no data' rather than a crash.","triggerScenarios":"Requesting trade between two countries that don't report bilateral flows to each other (e.g. small economy pairs); a `start_date`/`end_date` window before DOT series begin; `limit=0`-style degenerate parameter combos; IMF publication lag for recent periods.","commonSituations":"Batch loops over many country pairs where a minority of pairs have no data; very recent date ranges hitting publication lag; historical windows earlier than the DOT series start (commonly 1980s).","solutions":["Widen the date range or drop date filters to see if the pair has any history at all.","For batch jobs, catch `EmptyDataError` and record the pair as 'no data' instead of failing the run.","Try the world aggregate (`counterpart='W00'`) to confirm the reporter itself has data.","Retry once to rule out a transient empty IMF response."],"exampleFix":"# before\nres = obb.economy.direction_of_trade(provider='imf', country='USA', counterpart='ATA', start_date='2024-01-01')\n\n# after\nres = obb.economy.direction_of_trade(provider='imf', country='USA', counterpart='W00')","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from openbb_core.app.model.empty_data import EmptyDataError\n\ntry:\n    res = obb.economy.direction_of_trade(provider='imf', country=c, counterpart=cp, start_date=sd)\nexcept EmptyDataError:\n    res = None  # pair has no reported bilateral trade; record and continue the batch","preventionTips":["Design batch jobs over country pairs to tolerate EmptyDataError per pair.","Sanity-check a pair with counterpart='W00' before drilling into specific partners.","Keep date ranges within known DOT coverage (roughly 1980s onward) to avoid guaranteed-empty windows."],"tags":["imf","openbb","direction-of-trade","empty-data","remote-api"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}