{"record":{"id":"4693fed86275ead9","repo":"OpenBB-finance/OpenBB","slug":"the-request-was-returned-empty-4693fe","errorCode":null,"errorMessage":"The request was returned empty.","messagePattern":"The request was returned empty\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/intrinio/openbb_intrinio/models/equity_historical.py","lineNumber":265,"sourceCode":"\n                all_data.extend(response_data.get(data_key, []))  # type: ignore\n                next_page = response_data.get(\"next_page\", None)  # type: ignore\n\n            return all_data\n\n        url = f\"{base_url}&{query_str}&api_key={api_key}\"\n\n        return await amake_request(url, response_callback=callback, **kwargs)  # type: ignore\n\n    @staticmethod\n    def transform_data(\n        query: IntrinioEquityHistoricalQueryParams,\n        data: list[dict],\n        **kwargs: Any,\n    ) -> list[IntrinioEquityHistoricalData]:\n        \"\"\"Return the transformed data.\"\"\"\n        if not data:\n            raise EmptyDataError(\"The request was returned empty.\")\n        date_col = (\n            \"time\"\n            if query.interval in [\"1m\", \"5m\", \"10m\", \"15m\", \"30m\", \"60m\", \"1h\"]\n            else \"date\"\n        )\n        return [\n            IntrinioEquityHistoricalData.model_validate(d)\n            for d in sorted(data, key=lambda x: x[date_col], reverse=False)\n        ]\n","sourceCodeStart":247,"sourceCodeEnd":275,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_historical.py#L247-L275","documentation":"EmptyDataError raised in IntrinioEquityHistoricalFetcher.transform_data when the raw data list is empty after fetch. The API call succeeded (no error key) but returned zero bars for the symbol/parameters, so there is nothing to sort on the date/time column or validate into IntrinioEquityHistoricalData.","triggerScenarios":"Valid symbol with no price rows in the requested window (date range before listing, weekend-only range for daily bars, or a range with no trading data); a frequency/interval combination that yields no rows; thinly traded securities.","commonSituations":"Backtesting scripts looping over date windows that run past a ticker's listing date; requesting daily bars for a window entirely on weekends/holidays; using a newly listed ticker with an old start_date.","solutions":["Set start_date/end_date to a window where the security actually traded","Verify listing dates for the symbol and clamp your request range","Catch EmptyDataError and skip/continue in batch loops — it is a normal 'no rows' outcome, not a bug"],"exampleFix":"# before\ndf = obb.equity.price.historical(provider=\"intrinio\", symbol=\"TSLA\", start_date=\"1999-01-01\", end_date=\"1999-02-01\").to_df()\n\n# after\ndf = obb.equity.price.historical(provider=\"intrinio\", symbol=\"TSLA\", start_date=\"2024-01-01\", end_date=\"2024-02-01\").to_df()","handlingStrategy":"try-catch","validationCode":"from datetime import datetime, timedelta\n\ndef plausible_date_range(symbol_listed: datetime, start: str, end: str) -> bool:\n    s, e = datetime.fromisoformat(start), datetime.fromisoformat(end)\n    return s < e and s >= symbol_listed and e <= datetime.now() + timedelta(days=1)","typeGuard":"from openbb_core.provider.utils.errors import EmptyDataError","tryCatchPattern":"from openbb_core.provider.utils.errors import EmptyDataError\n\ntry:\n    bars = await obb.equity.price.historical(provider=\"intrinio\", symbol=sym, start_date=s, end_date=e)\nexcept EmptyDataError:\n    bars = []  # no rows in window — expected outcome","preventionTips":["Clamp date windows to listing dates per ticker","Skip non-trading windows in daily-bar backfills","Treat empty as a skip, not an error, in loops"],"tags":["empty-data","equity-historical","intrinio","no-results","prices"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}