{"record":{"id":"113e1efbed392f91","repo":"OpenBB-finance/OpenBB","slug":"all-cannot-be-used-with-other-country-codes-in-a","errorCode":null,"errorMessage":"'all' cannot be used with other country codes in a list.","messagePattern":"'all' cannot be used with other country codes in a list\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/models/direction_of_trade.py","lineNumber":77,"sourceCode":"        if not v:\n            raise ValueError(\"Required parameter for IMF provider not supplied.\")\n\n        if isinstance(v, str) and v.lower() in [\"all\", \"*\"]:\n            return \"*\"\n\n        # Split by comma if string\n        values = (\n            v.split(\",\")\n            if isinstance(v, str) and \",\" in v\n            else [v] if isinstance(v, str) else v\n        )\n\n        result: list[str] = []\n        for item in values:\n            item_stripped = item.strip()\n            if item_stripped.lower() in [\"all\", \"*\"]:\n                if len(values) > 1:\n                    raise ValueError(\n                        \"'all' cannot be used with other country codes in a list.\"\n                    )\n                return \"*\"\n            # Resolve the country input (handles both codes and names)\n            resolved = resolve_country_input(item_stripped)\n            result.append(resolved)\n\n        return \",\".join(result)\n\n\nclass ImfDirectionOfTradeData(DirectionOfTradeData):\n    \"\"\"IMF Direction Of Trade Data.\"\"\"\n\n    model_config = ConfigDict(extra=\"ignore\")\n    __alias_dict__ = {\n        \"date\": \"TIME_PERIOD\",\n        \"symbol\": \"series_id\",\n        \"country\": \"COUNTRY\",","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/models/direction_of_trade.py#L59-L95","documentation":"Error \"'all' cannot be used with other country codes in a list.\" thrown in OpenBB-finance/OpenBB.","triggerScenarios":"Thrown at openbb_platform/providers/imf/openbb_imf/models/direction_of_trade.py:77 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use 'all' alone, not combined with other country codes.","Or remove 'all' and list specific country codes."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}