{"record":{"id":"6ed09b4f0ba9ec09","repo":"OpenBB-finance/OpenBB","slug":"charting-is-not-installed-please-install-openbb","errorCode":null,"errorMessage":"Charting is not installed. Please install `openbb-charting`.","messagePattern":"Charting is not installed\\. Please install `openbb-charting`\\.","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/core/openbb_core/app/command_runner.py","lineNumber":269,"sourceCode":"        obbject = await maybe_coroutine(func, **kwargs)\n        if isinstance(obbject, OBBject):\n            obbject.provider = getattr(\n                kwargs.get(\"provider_choices\"),\n                \"provider\",\n                getattr(obbject, \"provider\", None),\n            )\n        return obbject\n\n    @classmethod\n    def _chart(\n        cls,\n        obbject: OBBject,\n        **kwargs,\n    ) -> None:\n        \"\"\"Create a chart from the command output.\"\"\"\n        try:\n            if \"charting\" not in obbject.accessors:\n                raise OpenBBError(\n                    \"Charting is not installed. Please install `openbb-charting`.\"\n                )\n            # Here we will pop the chart_params kwargs and flatten them into the kwargs.\n            chart_params = {}\n            extra_params = getattr(obbject, \"_extra_params\", {})\n\n            if extra_params and \"chart_params\" in extra_params:\n                chart_params = extra_params.get(\"chart_params\", {})\n\n            if kwargs.get(\"chart_params\"):\n                chart_params.update(kwargs.pop(\"chart_params\", {}))\n            # Verify that kwargs is not nested as kwargs so we don't miss any chart params.\n            if (\n                \"kwargs\" in kwargs\n                and \"chart_params\" in kwargs[\"kwargs\"]\n                and kwargs[\"kwargs\"].get(\"chart_params\")\n            ):\n                chart_params.update(kwargs.pop(\"kwargs\", {}).get(\"chart_params\", {}))","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/core/openbb_core/app/command_runner.py#L251-L287","documentation":"Raised by the Direction-of-Trade query-params validator (shared by `country` and `counterpart` fields, mode='before') when the incoming value is falsy — None, empty string, or empty list. DOT queries are bilateral, so both a reporting country and a counterpart are mandatory. Fails at model construction before any IMF call.","triggerScenarios":"Calling the DOT endpoint with `country=''` or omitted, or `counterpart=None`. Note this checks falsiness, not validity — a whitespace-only string like `' '` passes this guard and fails later in country resolution.","commonSituations":"Assuming DOT has a default counterpart (e.g. 'W00' world) when it requires one explicitly; blank form fields mapped to empty strings; programmatic loops where one iteration yields an empty code list.","solutions":["Pass both parameters, e.g. `country='USA', counterpart='W00'` (or '*' for all counterparts).","If you want aggregates, use the supported wildcard `counterpart='all'` rather than omitting it.","Add a truthiness check for both fields in your wrapper before calling the endpoint."],"exampleFix":"# before\nres = obb.economy.direction_of_trade(provider='imf', country='USA')\n\n# after\nres = obb.economy.direction_of_trade(provider='imf', country='USA', counterpart='W00')","handlingStrategy":"validation","validationCode":"def validate_dot_params(country, counterpart):\n    if not country or not counterpart:\n        raise ValueError('IMF direction-of-trade requires non-empty country and counterpart.')\n\nvalidate_dot_params(country, counterpart)","typeGuard":"def has_dot_pair(country, counterpart) -> bool:\n    return bool(country) and bool(counterpart)","tryCatchPattern":null,"preventionTips":["Treat counterpart as mandatory — there is no default; use 'W00' (world) or 'all' for breadth.","Watch for whitespace-only strings: they pass the falsy check here but fail country resolution later, so strip inputs in your wrapper."],"tags":["imf","openbb","direction-of-trade","validation","required-parameter","pydantic"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}