{"record":{"id":"d348a84a60a6cb53","repo":"OpenBB-finance/OpenBB","slug":"invalid-value-s-for-dimension-country-invalid","errorCode":null,"errorMessage":"Invalid value(s) for dimension 'country': {invalid}. Given prior selections {{'indicator': '{','.join(indicator_codes)}'}}, available values are: {sorted(available_countries)}","messagePattern":"Invalid value\\(s\\) for dimension 'country': (.+?)\\. Given prior selections (.+?)'\\}\\}, available values are: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/models/economic_indicators.py","lineNumber":506,"sourceCode":"                \"BOP_ACCOUNTING_ENTRY\",\n                \"ACTIVITY\",\n            ]\n            indicator_dim = next(\n                (d for d in indicator_dim_candidates if d in dim_order), None\n            )\n\n            # Validate country\n            if self.country and country_dim in dim_order:\n                available_countries = get_available_values(country_dim, dataflow_id)\n                if available_countries:\n                    countries = [c.strip().upper() for c in self.country.split(\",\")]  # type: ignore  # pylint: disable=E1101\n                    invalid = [\n                        c\n                        for c in countries\n                        if c not in available_countries and c not in (\"*\", \"all\")\n                    ]\n                    if invalid:\n                        raise ValueError(\n                            f\"Invalid value(s) for dimension 'country': {invalid}. \"\n                            + f\"Given prior selections {{'indicator': '{','.join(indicator_codes)}'}}, \"\n                            + f\"available values are: {sorted(available_countries)}\"\n                        )\n\n            if (\n                self.frequency\n                and self.frequency.lower() not in (\"all\", \"*\")  # type: ignore  # pylint: disable=E1101\n                and freq_dim in dim_order\n            ):\n                freq_map = {\"annual\": \"A\", \"quarter\": \"Q\", \"month\": \"M\", \"day\": \"D\"}\n                freq_val = freq_map.get(str(self.frequency).lower(), self.frequency)\n                available_freqs = get_available_values(freq_dim, dataflow_id)\n                if available_freqs and freq_val not in available_freqs:\n                    indicator_str = \",\".join(indicator_codes)\n                    raise ValueError(\n                        f\"Invalid value(s) for dimension 'frequency': ['{freq_val}']. \"\n                        f\"Given prior selections {{'country': '{self.country}', \"","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/models/economic_indicators.py#L488-L524","documentation":"Error \"Invalid value(s) for dimension 'country': {invalid}. Given prior selections {{'indicator': '{','.join(indicator_codes)}'}}, available values are: {sorted(available_countries)}\" thrown in OpenBB-finance/OpenBB.","triggerScenarios":"Thrown at openbb_platform/providers/imf/openbb_imf/models/economic_indicators.py:506 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose country values from the listed available values for the selected indicators.","Adjust the indicator selection if the desired countries are unavailable."],"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"}