OpenBB-finance/OpenBB · warning · EmptyDataError
No data found
Error message
No data found
What it means
transform_data raises EmptyDataError when the fetcher hands it an empty list — i.e. the Deribit API was reached but returned zero instruments for the underlying. OpenBB uses EmptyDataError as a well-known signal that the request succeeded but no rows exist, so the framework (and callers) can distinguish 'no data' from 'error'. For a BTC/ETH/PAXG curve this usually means the upstream snapshot fetch returned nothing.
Source
Thrown at openbb_platform/providers/deribit/openbb_deribit/models/futures_curve.py:156
if hours_data:
data.extend(hours_data)
return data
except Exception as e: # pylint: disable=broad-except
raise OpenBBError(
f"Failed to get futures curve -> {e.__class__.__name__ if hasattr(e, '__class__') else e}: {e.args}"
) from e
@staticmethod
def transform_data(
query: DeribitFuturesCurveQueryParams, data: list, **kwargs: Any
) -> list[DeribitFuturesCurveData]:
"""Transform the data."""
# pylint: disable=import-outside-toplevel
from datetime import datetime # noqa
from pandas import to_datetime
if not data:
raise EmptyDataError("No data found")
futures_curve: list[DeribitFuturesCurveData] = []
for d in data:
if not d:
continue
ins_name = d.get("instrument_name", "")
exp = ins_name.split("-")[1]
hours_ago = d.get("hours_ago", 0)
exp = (
datetime.today().strftime("%Y-%m-%d")
if exp == "PERPETUAL"
else to_datetime(exp).strftime("%Y-%m-%d")
)
price = d.get("last_price", d.get("mark_price"))
View on GitHub (pinned to 3e071fcc2c)
Solutions
- Retry once — transient empty responses from Deribit usually resolve immediately
- Try BTC or ETH to confirm the endpoint works, then re-try the original symbol
- Handle EmptyDataError explicitly in callers as 'no rows' rather than propagating an error
Example fix
# before
res = obb.derivatives.futures.curve(symbol='PAXG', provider='deribit')
# after
from openbb_core.provider.abstract.fetcher import EmptyDataError
try:
res = obb.derivatives.futures.curve(symbol='PAXG', provider='deribit')
except EmptyDataError:
res = [] # no futures currently listed for this underlying Defensive patterns
Strategy: fallback
Try / catch
from openbb_core.provider.abstract.fetcher import EmptyDataError
try:
curve = obb.derivatives.futures.curve(symbol=sym, provider='deribit').to_df()
except EmptyDataError:
curve = pd.DataFrame() # no futures listed for this underlying right now Prevention
- Catch EmptyDataError as a distinct 'no rows' outcome in every consumer
- Verify with BTC/ETH that the endpoint works before assuming code is broken
- Retry once before giving up — transient empty responses occur
When it happens
Trigger: Symbol with no currently listed futures (possible for PAXG during low listing periods); upstream helper returned an empty instrument list due to a filtered/malformed response; hours_ago snapshot cache empty so comparison fetch yields nothing.
Common situations: Querying PAXG when Deribit has no listed dated futures; transient Deribit response anomalies; running immediately after market maintenance windows.
Related errors
- [Empty] -> {e}
- No data found.
- No data found for the given symbol and dates.
- No data found in the response. URL: {url}
- No data rows found for dataflow '{dataflow}' with parameters
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/dee21d95a213f0ef.
Report an issue: GitHub.