OpenBB-finance/OpenBB · error · EmptyDataError
No data found for the given query parameters.
Error message
No data found for the given query parameters.
What it means
Error "No data found for the given query parameters." thrown in OpenBB-finance/OpenBB.
Source
Thrown at openbb_platform/providers/imf/openbb_imf/models/direction_of_trade.py:181
query.end_date.strftime("%Y-%m-%d") if query.end_date else None
),
**kwargs,
)
except (ValueError, OpenBBError) as e:
raise OpenBBError(e) from e
@staticmethod
def transform_data(
query: ImfDirectionOfTradeQueryParams,
data: dict,
**kwargs: Any,
) -> AnnotatedResult[list[ImfDirectionOfTradeData]]:
"""Transform the data."""
meta = data.get("metadata", {})
records = data.get("data", [])
if not records:
raise EmptyDataError("No data found for the given query parameters.")
return AnnotatedResult(
result=[
ImfDirectionOfTradeData.model_validate(record) for record in records
],
metadata=meta,
)
View on GitHub (pinned to 3e071fcc2c)
Solutions
- Adjust the query parameters: widen the date range or change countries.
- Verify the country/counterpart combination has published trade data.
When it happens
Trigger: Thrown at openbb_platform/providers/imf/openbb_imf/models/direction_of_trade.py:181 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/7743f7242501b51f.
Report an issue: GitHub.