{"record":{"id":"cd69c7208ea197a3","repo":"OpenBB-finance/OpenBB","slug":"no-data-was-found-for-the-supplied-date-range-and","errorCode":null,"errorMessage":"No data was found for the supplied date range and countries.","messagePattern":"No data was found for the supplied date range and countries\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/econdb/openbb_econdb/models/gdp_nominal.py","lineNumber":204,"sourceCode":"    @staticmethod\n    def transform_data(\n        query: EconDbGdpNominalQueryParams,\n        data: list[dict],\n        **kwargs,\n    ) -> list[EconDbGdpNominalData]:\n        \"\"\"Transform the data.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from pandas import DataFrame, to_datetime\n\n        df = DataFrame(data)\n\n        if query.start_date:\n            df = df[to_datetime(df[\"date\"]) >= to_datetime(query.start_date)]\n        if query.end_date:\n            df = df[to_datetime(df[\"date\"]) <= to_datetime(query.end_date)]\n\n        if df.empty:  # type: ignore\n            raise EmptyDataError(\n                \"No data was found for the supplied date range and countries.\"\n            )\n\n        df = df.set_index([\"date\", \"country\"])  # type: ignore\n        df = df.dropna()\n        df[\"value\"] = (df[\"value\"] * 1_000_000_000).astype(\"int64\")\n        df[\"nominal_growth_qoq\"] = df[\"nominal_growth_qoq\"] / 100\n        df[\"nominal_growth_yoy\"] = df[\"nominal_growth_yoy\"] / 100\n        df = df.reset_index()\n        df = df.sort_values(by=[\"date\", \"value\"], ascending=[True, False])\n\n        return [\n            EconDbGdpNominalData.model_validate(d) for d in df.to_dict(orient=\"records\")\n        ]\n","sourceCodeStart":186,"sourceCodeEnd":219,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/econdb/openbb_econdb/models/gdp_nominal.py#L186-L219","documentation":"EmptyDataError raised in EconDbGdpNominalFetcher.transform_data after filtering the fetched records by query.start_date / query.end_date: the DataFrame became empty, meaning data exists but not inside the requested window. Note the fetch step succeeded — this is purely a date-range mismatch.","triggerScenarios":"economy.gdp_nominal(provider='econdb', start_date/end_date set to a period before the series begins or after its latest observation, e.g. start_date='1990-01-01' for a country whose series starts in 2000, or a future end_date window with no data.","commonSituations":"Defaulting start_date far in the past; querying very recent quarters that are not yet published; timezone/day-boundary off-by-one on end_date.","solutions":["Widen or remove start_date/end_date and inspect the returned date range.","Set start_date to the earliest date you actually need rather than a sentinel like '1900-01-01'.","For recent periods, remember quarterly GDP lags — pull the last available quarter instead of the current one."],"exampleFix":"# before\nres = obb.economy.gdp_nominal(provider='econdb', country='us', start_date='1950-01-01', end_date='1960-01-01')  # before series begins\n\n# after - omit dates to discover coverage first\nres = obb.economy.gdp_nominal(provider='econdb', country='us')\nprint(res.to_df().date.min(), res.to_df().date.max())","handlingStrategy":"validation","validationCode":"full = obb.economy.gdp_nominal(provider='econdb', country='us').to_df()\nlo, hi = full['date'].min(), full['date'].max()\nif start_date < lo or end_date > hi:\n    raise ValueError(f'requested {start_date}..{end_date} outside coverage {lo}..{hi}')","typeGuard":null,"tryCatchPattern":"from openbb_core.provider.utils.errors import EmptyDataError\ntry:\n    res = obb.economy.gdp_nominal(provider='econdb', country='us', start_date=s, end_date=e)\nexcept EmptyDataError:\n    res = obb.economy.gdp_nominal(provider='econdb', country='us')  # full range, filter locally","preventionTips":["Discover coverage once, cache the min/max dates, and clamp future requests.","Avoid sentinel ancient start dates.","Filter date ranges locally after a full fetch when coverage is unknown."],"tags":["date-range","empty-data","gdp","validation"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}