{"record":{"id":"8ef60f0caaf4b638","repo":"OpenBB-finance/OpenBB","slug":"please-install-polars-pip-install-polars-pyarrow","errorCode":null,"errorMessage":"Please install polars: `pip install polars pyarrow`  to use this method.","messagePattern":"Please install polars: `pip install polars pyarrow`  to use this method\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"openbb_platform/core/openbb_core/app/model/obbject.py","lineNumber":292,"sourceCode":"        except ValueError as ve:\n            raise OpenBBError(\n                f\"ValueError: {ve}. Ensure the data format matches the expected format.\"\n            ) from ve\n        except TypeError as te:\n            raise OpenBBError(\n                f\"TypeError: {te}. Check the data types in your results.\"\n            ) from te\n        except Exception as ex:\n            raise OpenBBError(f\"An unexpected error occurred: {ex}\") from ex\n\n        return df\n\n    def to_polars(self) -> \"PolarsDataFrame\":  # type: ignore\n        \"\"\"Convert results field to polars dataframe.\"\"\"\n        try:\n            from polars import from_pandas  # type: ignore # pylint: disable=import-outside-toplevel\n        except ImportError as exc:\n            raise ImportError(\n                \"Please install polars: `pip install polars pyarrow`  to use this method.\"\n            ) from exc\n\n        return from_pandas(self.to_dataframe(index=None))\n\n    def to_numpy(self) -> \"ndarray\":\n        \"\"\"Convert results field to numpy array.\"\"\"\n        return self.to_dataframe(index=None).to_numpy()\n\n    def to_dict(\n        self,\n        orient: Literal[\n            \"dict\", \"list\", \"series\", \"split\", \"tight\", \"records\", \"index\"\n        ] = \"list\",\n    ) -> dict[Hashable, Any] | list[dict[Hashable, Any]]:\n        \"\"\"Convert results field to a dictionary using any of Pandas `to_dict` options.\n\n        Parameters","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/core/openbb_core/app/model/obbject.py#L274-L310","documentation":"Raised in the economic-indicators validator's dimension cross-check when a supplied country code is not among the dataflow's available country-dimension values, given the already-selected indicator(s). IMF SDMX dimensions are constrained by prior selections, so a code that is globally valid ISO3 can still be invalid for that indicator/dataflow combination. '*' and 'all' are exempted from the check.","triggerScenarios":"`symbol='IFS::NGDP_XDC', country='ATA'` where Antarctica is not in IFS's REF_AREA values; country codes for territories/aggregates (e.g. 'EMU') that a dataflow doesn't report; a country valid for one indicator but dropped from the codelist for the chosen indicator.","commonSituations":"Looping a fixed country list over many indicators where coverage differs; using aggregate codes from other endpoints; IMF codelist revisions (version drift between provider metadata and live API).","solutions":["Read the `available values` list in the error message and restrict to those countries.","Query the dataflow's dimension values via the provider's metadata helpers (ImfMetadata / list endpoints) before building the country list.","Use `country='all'` to fetch everything and filter client-side.","Upgrade openbb-imf if the codelist changed upstream."],"exampleFix":"# before\nres = obb.economy.economic_indicators(provider='imf', symbol='IFS::NGDP_XDC', country='ATA')\n\n# after\nres = obb.economy.economic_indicators(provider='imf', symbol='IFS::NGDP_XDC', country='USA')","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    res = obb.economy.economic_indicators(provider='imf', symbol=sym, country=c, frequency=f)\nexcept Exception as e:\n    msg = str(e)\n    if 'available values are' in msg:\n        # dimension cross-check failure: parse the listed values and re-issue\n        available = msg.split('available values are:')[-1].strip()\n        res = obb.economy.economic_indicators(provider='imf', symbol=sym, country='all', frequency=f)\n    else:\n        raise","preventionTips":["Don't assume ISO3 validity implies availability — coverage varies per dataflow and per indicator.","For unknown coverage, request country='all' once and learn the actual codelist from the result.","In batch loops over (indicator, country) pairs, catch and log cross-check failures per pair instead of failing the run."],"tags":["imf","openbb","validation","country-code","sdmx","codelist"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}