OpenBB-finance/OpenBB · warning · EmptyDataError
The request was returned empty.
Error message
The request was returned empty.
What it means
FMP calendar events fetcher queries multiple URLs (e.g. earnings, IPO, dividend calendars) and, if every response is empty, raises EmptyDataError('The request was returned empty.'). The upstream get_data succeeded; each endpoint simply had no rows for the window.
Source
Thrown at openbb_platform/providers/fmp/openbb_fmp/models/calendar_events.py:131
to_date = date_ranges[i + 1].strftime("%Y-%m-%d")
urls.append(
f"{base_url}from={from_date}&to={to_date}&limit=1000&apikey={api_key}"
)
async def get_one(url):
"""Get data from one URL."""
try:
response = await get_data(url, **kwargs)
except OpenBBError as e:
raise e from e
if response:
results.extend(response)
await asyncio.gather(*[get_one(url) for url in urls])
if not results:
raise EmptyDataError("The request was returned empty.")
return sorted(results, key=lambda x: x["date"])
@staticmethod
def transform_data(
query: FmpCalendarEventsQueryParams, data: list, **kwargs: Any
) -> list[FmpCalendarEventsData]:
"""Transform the data."""
return [FmpCalendarEventsData.model_validate(d) for d in data]
View on GitHub (pinned to 3e071fcc2c)
Solutions
- Widen the start_date/end_date window to include known event dates
- Confirm start_date <= end_date and both are within FMP's supported range
- Treat EmptyDataError as a normal empty calendar in scheduled jobs
Example fix
# before await obb.equity.calendar.events(provider="fmp", start_date="2024-01-06", end_date="2024-01-07") # weekend # after await obb.equity.calendar.events(provider="fmp", start_date="2024-01-01", end_date="2024-01-31")
Defensive patterns
Strategy: validation
Validate before calling
from datetime import date assert start_date <= end_date, "start_date must precede end_date" assert (end_date - start_date).days >= 7, "window very narrow; may contain no events"
Try / catch
from openbb_core.provider.abstract.errors import EmptyDataError
try:
events = await FmpCalendarEventsFetcher.transform_query(...)
except EmptyDataError:
events = [] # no events in window; widen dates if unexpected Prevention
- Use event windows of at least a week for quiet periods
- Validate date order and format (YYYY-MM-DD) before requesting
- Treat empty calendars as normal output in scheduled jobs
When it happens
Trigger: Requesting calendar events for a date range with no events (quiet weeks, weekends); start/end dates inverted or outside FMP coverage; a premium event type on a free key returning empty.
Common situations: Nightly jobs over rolling short windows that regularly contain no events; date arguments passed in the wrong order; timezone shifts making 'today' land on an empty day.
Related errors
- No data found for the given query -> {query.model_dump()}
- No data returned for the given symbols.
- No data was returned for the given query.
- Error serializing output for an extension-modified endpoint
- OBBject Extension Error -> An OBBject extension that acts
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/0ee2432a58d13967.
Report an issue: GitHub.