OpenBB-finance/OpenBB · error · OpenBBError
No data found in the response.
Error message
No data found in the response.
What it means
Raised in `transform_data` of the chokepoint info model when the fetched payload is falsy or lacks a 'features' key. The ArcGIS GeoJSON contract puts records under `features`; its absence means the endpoint responded 200 but with an error object, an empty envelope, or a differently-shaped body — so the model refuses to iterate a missing key.
Source
Thrown at openbb_platform/providers/imf/openbb_imf/models/maritime_chokepoint_info.py:179
url
) as response:
if response.status != 200:
raise OpenBBError(f"Failed to fetch data: {response.status}")
return await response.json()
except Exception as e:
raise OpenBBError(e) from e
@staticmethod
def transform_data(
query: ImfMaritimeChokePointInfoQueryParams,
data: dict,
**kwargs: Any,
) -> list[ImfMaritimeChokePointInfoData]:
"""Transform the raw data into a list of ImfMaritimeChokePointInfoData."""
if not data or "features" not in data:
raise OpenBBError("No data found in the response.")
return [
ImfMaritimeChokePointInfoData(**feature["properties"])
for feature in data["features"]
]
View on GitHub (pinned to 3e071fcc2c)
Solutions
- Re-run the raw query manually and inspect the JSON body — an ArcGIS 'error' object usually names the real cause (bad layer, expired service).
- Retry later if the body indicates a transient server error code.
- Upgrade the openbb_imf provider if PortWatch changed its response shape and a newer provider handles it.
Defensive patterns
Strategy: try-catch
Type guard
def is_chokepoint_geojson(payload) -> bool:
return isinstance(payload, dict) and isinstance(payload.get('features'), list) Try / catch
except OpenBBError as e:
if 'No data found in the response' in str(e):
# endpoint returned 200 with an error envelope; backoff and retry once
await asyncio.sleep(5)
info = await obb.economy.imf.maritime_chokepoint_info() Prevention
- Shape-check raw ArcGIS payloads in custom integrations before reading 'features'
- Treat 200-with-error-body as a known ArcGIS failure mode
When it happens
Trigger: ArcGIS returning a 200 response whose body is an error JSON (e.g. {'error': {...}}), a `features: []` shape change, or an empty dict passed straight to transform_data (e.g. from a mocked or cached fetch).
Common situations: ArcGIS error envelopes that still use HTTP 200; schema drift in the PortWatch hosted layer; unit tests feeding incomplete fixture dicts into transform_data.
Related errors
- Failed to fetch data: {response.status}
- The response was returned empty with no error message.
- Failed to fetch data: {response.status} -> {response.reason}
- Failed to fetch data: {response.status}
- Failed to fetch ports data: {response.status} - {response.re
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/1e7fbbae1390ffb5.
Report an issue: GitHub.