OpenBB-finance/OpenBB · warning · EmptyDataError
No data was found for the country, {query.country}, and date
Error message
No data was found for the country, {query.country}, and dates, {query.date} What it means
EmptyDataError from EconDbYieldCurveFetcher.transform_data: raw series data was fetched for the requested countries, but after reshaping and dropping rows without a 'rate' value, results_data is empty for query.date. The curve for that date simply does not exist in the fetched series (weekend, holiday, or pre-publication date).
Source
Thrown at openbb_platform/providers/econdb/openbb_econdb/models/yield_curve.py:262
return int(unit)
return int(unit) / 12
new_df["maturity_years"] = new_df.maturity.apply(convert_duration)
new_df = new_df.replace({nan: None})
records = [
EconDbYieldCurveData.model_validate(r)
for r in new_df.to_dict("records")
if r.get("rate")
]
results_data.extend(records)
results_metadata[country] = metadata
for country, country_data in data.items():
process_country_data(country, country_data)
if not results_data:
raise EmptyDataError(
f"No data was found for the country, {query.country}, and dates, {query.date}"
)
return AnnotatedResult(result=results_data, metadata=results_metadata)
View on GitHub (pinned to 3e071fcc2c)
Solutions
- Use the most recent weekday for the requested markets.
- Omit date and check what the latest available curve date is in the returned metadata.
- For a specific past date, confirm it was a trading day in that country's bond market.
Example fix
# before
obb.economy.yield_curve(provider='econdb', date='2026-08-15') # Saturday
# after
from datetime import date, timedelta
last_bday = date(2026, 8, 14)
while last_bday.weekday() >= 5:
last_bday -= timedelta(days=1)
obb.economy.yield_curve(provider='econdb', date=last_bday) Defensive patterns
Strategy: validation
Validate before calling
from datetime import date, timedelta
d = query_date or date.today()
while d.weekday() >= 5:
d -= timedelta(days=1)
# further guard: country-specific holidays may still yield no curve - retry d-1 on empty Try / catch
from openbb_core.provider.utils.errors import EmptyDataError
from datetime import timedelta
for _ in range(5):
try:
res = obb.economy.yield_curve(provider='econdb', country=c, date=d)
break
except EmptyDataError:
d -= timedelta(days=1) # walk back over holidays
else:
raise Prevention
- Walk back from weekends/holidays one day at a time on empty results.
- Omit date and read the latest available date from result metadata.
- Remember different countries have different holiday calendars.
When it happens
Trigger: economy.yield_curve(provider='econdb', date=D) where D is a non-trading day or a day with no rate observations for all requested countries — extraction succeeds (series exist) but the date slice is empty.
Common situations: Weekend/holiday dates; asking for today's curve before publication; dates earlier than a country's series start.
Related errors
- "\n".join(messages) # messages contain e.g. 'No data was re
- Error: The no data was found for the supplied symbols and co
- No data found for the provided dates. Data has a range from
- Error: No data to plot.
- The request was returned empty.
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/f4a08b1a68f8e530.
Report an issue: GitHub.