{"record":{"id":"de306a8e4617c443","repo":"OpenBB-finance/OpenBB","slug":"there-was-an-error-fetching-the-data","errorCode":null,"errorMessage":"There was an error fetching the data.","messagePattern":"There was an error fetching the data\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/econdb/openbb_econdb/models/available_indicators.py","lineNumber":93,"sourceCode":"\n    @staticmethod\n    def transform_query(params: dict[str, Any]) -> EconDbAvailableIndicatorsQueryParams:\n        \"\"\"Transform query.\"\"\"\n        return EconDbAvailableIndicatorsQueryParams(**params)\n\n    @staticmethod\n    async def aextract_data(\n        query: EconDbAvailableIndicatorsQueryParams,\n        credentials: dict[str, str] | None,\n        **kwargs: Any,\n    ) -> list[dict]:\n        \"\"\"Extract data.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from openbb_econdb.utils.helpers import download_indicators\n\n        df = await download_indicators(query.use_cache)\n        if df.empty:\n            raise EmptyDataError(\"There was an error fetching the data.\")\n        return df.sort_values(by=\"last_date\", ascending=False).to_dict(orient=\"records\")\n\n    @staticmethod\n    def transform_data(\n        query: EconDbAvailableIndicatorsQueryParams,\n        data: list[dict],\n        **kwargs: Any,\n    ) -> list[EconDbAvailableIndicatorsData]:\n        \"\"\"Transform data.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from math import isnan\n\n        def clean_nan(d: dict) -> dict:\n            \"\"\"Replace nan values with None for Pydantic validation.\"\"\"\n            return {\n                k: None if isinstance(v, float) and isnan(v) else v\n                for k, v in d.items()\n            }","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/econdb/openbb_econdb/models/available_indicators.py#L75-L111","documentation":"EmptyDataError from the EconDB available-indicators model when download_indicators(use_cache) returns an empty DataFrame. The indicator catalog (scraped/cached from EconDB) came back with zero rows, so there is nothing to list.","triggerScenarios":"Calling obb.economy.indicators(provider='econdb') (available indicators endpoint) when the catalog fetch failed silently or the cached copy is empty/corrupt. With use_cache=True, a previously stored empty response keeps reproducing the error.","commonSituations":"First run behind a network that blocks econdb.com; stale/corrupt SQLite HTTP cache from an interrupted earlier fetch; EconDB site redesign breaking the scraper in an older provider version.","solutions":["Retry with use_cache=False to force a fresh catalog download.","Verify reachability of econdb.com from the same environment (curl the indicators endpoint).","Update the openbb-econdb provider — catalog scraping breaks when the site layout changes.","Clear the user HTTP cache directory if a poisoned empty response is stored."],"exampleFix":"# before\ninds = obb.economy.indicators(provider=\"econdb\")\n\n# after\ninds = obb.economy.indicators(provider=\"econdb\", use_cache=False)","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"from openbb_core.provider.utils.errors import EmptyDataError\ntry:\n    inds = obb.economy.indicators(provider=\"econdb\")\nexcept EmptyDataError:\n    inds = obb.economy.indicators(provider=\"econdb\", use_cache=False)  # bypass poisoned cache","preventionTips":["Retry once with use_cache=False to rule out a cached empty catalog.","Verify econdb.com reachability from the runtime environment.","Keep openbb-econdb current; the catalog scraper breaks on site redesigns."],"tags":["econdb","catalog","empty-data","cache","scraping"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}