{"record":{"id":"9d975184a1dd176d","repo":"OpenBB-finance/OpenBB","slug":"the-request-returned-empty","errorCode":null,"errorMessage":"The request returned empty.","messagePattern":"The request returned empty\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/econdb/openbb_econdb/models/country_profile.py","lineNumber":294,"sourceCode":"            if (\n                \"Govt Debt/GDP\" in final_df.columns\n                and \"GDP ($B USD)\" in final_df.columns\n            ):\n                final_df[\"Govt Debt/GDP\"] = (\n                    final_df[\"Govt Debt/GDP\"] / final_df[\"GDP ($B USD)\"]\n                )\n            if \"Current Account/GDP\" in final_df.columns and _country == \"US\":\n                final_df[\"Current Account/GDP\"] = final_df[\"Current Account/GDP\"] * 4\n            if final_df.empty:\n                warn(f\"Error: No data returned for {_country}.\")\n            if not final_df.empty:\n                results.extend(final_df.reset_index().to_dict(orient=\"records\"))\n\n        chunks = [country[i : i + 3] for i in range(0, len(country), 3)]\n        for chunk in chunks:\n            await asyncio.gather(*[get_one_country(c) for c in chunk])\n        if not results:\n            raise EmptyDataError(\"The request returned empty.\")\n        return results\n\n    @staticmethod\n    def transform_data(\n        query: EconDbCountryProfileQueryParams,\n        data: list[dict],\n        **kwargs: Any,\n    ) -> list[EconDbCountryProfileData]:\n        \"\"\"Transform the data.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from openbb_econdb.utils.helpers import PROFILE_ORDER\n        from pandas import DataFrame\n\n        output_df = (\n            DataFrame(data)\n            .filter(items=[\"date\", \"Country\"] + PROFILE_ORDER, axis=1)\n            .sort_values(\"GDP ($B USD)\", ascending=False)\n            .fillna(\"N/A\")","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/econdb/openbb_econdb/models/country_profile.py#L276-L312","documentation":"EmptyDataError from the EconDB country-profile fetcher: countries validated fine, but after fetching each country's profile in chunks of 3, every country returned an empty DataFrame (each logged 'Error: No data returned for {country}'), so `results` stayed empty.","triggerScenarios":"Calling obb.economy.country_profile(provider='econdb', country='...') when EconDB's profile endpoint returns nothing for all requested countries — site outage/rewrite, token required, or countries EconDB simply has no profile table for.","commonSituations":"EconDB layout change breaking an older openbb-econdb version; requesting obscure territories EconDB lacks; API token (if configured) expired so all profile requests come back empty; transient full-site unavailability.","solutions":["Check the warnings output — it lists each country that returned nothing, telling you whether it's all or only some.","Retry with a well-covered country (US, DE, JP) to distinguish 'country unsupported' from 'site down'.","Update openbb-econdb; profile scraping breaks on site redesigns.","If all countries fail, verify econdb.com reachability and any configured credentials from your environment."],"exampleFix":"# before\nres = obb.economy.country_profile(provider=\"econdb\", country=\"all\")  # everything empty -> raises\n\n# after\nimport warnings\nwith warnings.catch_warnings(record=True) as w:\n    warnings.simplefilter(\"always\")\n    try:\n        res = obb.economy.country_profile(provider=\"econdb\", country=\"US\")\n    except Exception as e:\n        print([str(x.message) for x in w])  # which countries failed\n        raise","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"import warnings\nfrom openbb_core.provider.utils.errors import EmptyDataError\nwith warnings.catch_warnings(record=True) as w:\n    warnings.simplefilter(\"always\")\n    try:\n        res = obb.economy.country_profile(provider=\"econdb\", country=cs)\n    except EmptyDataError:\n        failed = [str(x.message) for x in w]  # which countries returned nothing\n        res = fallback_provider(cs) or None","preventionTips":["Probe with one well-covered country (US) to distinguish outage from coverage gap.","Capture warnings — they enumerate each country that returned empty.","Update openbb-econdb when EconDB changes its profile pages."],"tags":["econdb","country-profile","empty-data","scraping"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}