{"record":{"id":"f967482ec0cc4fe1","repo":"OpenBB-finance/OpenBB","slug":"no-valid-countries-were-supplied-f96748","errorCode":null,"errorMessage":"No valid countries were supplied.","messagePattern":"No valid countries were supplied\\.","errorType":"validation","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/econdb/openbb_econdb/models/gdp_real.py","lineNumber":77,"sourceCode":"                and c.upper() not in list(COUNTRY_MAP.values())\n                and c.lower() != \"g7\"\n            ) or (\n                len(c) > 3 and c.lower() not in list(COUNTRY_MAP) + list(COUNTRY_GROUPS)\n            ):\n                country.remove(c)\n            elif len(c) == 3 and c.lower() != \"g20\":\n                _c = THREE_LETTER_ISO_MAP.get(c.upper(), \"\")\n                if _c:  # pylint: disable=R0801\n                    country[country.index(c)] = _c\n                else:\n                    warn(f\"Error: {c} is not a valid country code.\")\n                    country.remove(c)\n            elif len(c) > 3 and c.lower() in COUNTRY_MAP:\n                country[country.index(c)] = COUNTRY_MAP[c.lower()].upper()\n            elif len(c) > 2 and c.lower() in COUNTRY_GROUPS:\n                country[country.index(c)] = \",\".join(COUNTRY_GROUPS[c.lower()])\n        if len(country) == 0:\n            raise OpenBBError(\"No valid countries were supplied.\")\n        return \",\".join(country)\n\n\nclass EconDbGdpRealData(GdpNominalData):\n    \"\"\"EconDB GDP Real Data.\"\"\"\n\n    real_growth_qoq: float = Field(\n        description=\"Real GDP growth rate quarter over quarter.\",\n        json_schema_extra={\"x-unit_measurement\": \"percent\", \"x-frontend_multiply\": 100},\n    )\n    real_growth_yoy: float = Field(\n        description=\"Real GDP growth rate year over year.\",\n        json_schema_extra={\"x-unit_measurement\": \"percent\", \"x-frontend_multiply\": 100},\n    )\n    value: int | float = Field(\n        description=\"Real GDP value for the country and date.\",\n        json_schema_extra={\"x-unit_measurement\": \"currency\"},\n    )","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/econdb/openbb_econdb/models/gdp_real.py#L59-L95","documentation":"Identical logic to gdp_nominal: EconDbGdpRealFetcher's transform_query normalizes the country list and drops unmappable entries (3-letter codes missing from THREE_LETTER_ISO_MAP, names absent from COUNTRY_MAP/COUNTRY_GROUPS). If nothing survives, OpenBBError('No valid countries were supplied.') is raised before any request is made; each rejected code also emits a warning.","triggerScenarios":"economy.gdp_real(provider='econdb', country=...) where every entry fails normalization — bad 2-letter code, misspelled long name, unknown group.","commonSituations":"Same as nominal GDP: typos, wrong case for long names ('United States' vs 'united_states'), unsupported 3-letter ISO codes.","solutions":["Use 2-letter ISO codes ('us', 'de') which bypass mapping.","Use underscore lowercase names from COUNTRY_MAP or a COUNTRY_GROUPS key like 'g20'.","Run with warnings visible to see which entries were rejected."],"exampleFix":"# before\nobb.economy.gdp_real(provider='econdb', country='United States')\n\n# after\nobb.economy.gdp_real(provider='econdb', country='united_states')  # or 'us'","handlingStrategy":"validation","validationCode":"from openbb_econdb.utils.helpers import COUNTRY_MAP, COUNTRY_GROUPS\nvalid = {c for c in COUNTRY_MAP} | set(COUNTRY_GROUPS) | {'g20'}\nclean = [c for c in inputs if len(c) == 2 or c.lower() in valid]\nif not clean:\n    raise ValueError(f'no valid countries among {inputs}')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use 2-letter ISO codes to skip normalization entirely.","Validate against the provider's own maps before calling.","Log warnings to catch silent drops."],"tags":["validation","country-codes","gdp","econdb"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}