{"record":{"id":"1e7fbbae1390ffb5","repo":"OpenBB-finance/OpenBB","slug":"no-data-found-in-the-response","errorCode":null,"errorMessage":"No data found in the response.","messagePattern":"No data found in the response\\.","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/models/maritime_chokepoint_info.py","lineNumber":179,"sourceCode":"                url\n            ) as response:\n                if response.status != 200:\n                    raise OpenBBError(f\"Failed to fetch data: {response.status}\")\n\n                return await response.json()\n\n        except Exception as e:\n            raise OpenBBError(e) from e\n\n    @staticmethod\n    def transform_data(\n        query: ImfMaritimeChokePointInfoQueryParams,\n        data: dict,\n        **kwargs: Any,\n    ) -> list[ImfMaritimeChokePointInfoData]:\n        \"\"\"Transform the raw data into a list of ImfMaritimeChokePointInfoData.\"\"\"\n        if not data or \"features\" not in data:\n            raise OpenBBError(\"No data found in the response.\")\n\n        return [\n            ImfMaritimeChokePointInfoData(**feature[\"properties\"])\n            for feature in data[\"features\"]\n        ]\n","sourceCodeStart":161,"sourceCodeEnd":185,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/models/maritime_chokepoint_info.py#L161-L185","documentation":"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.","triggerScenarios":"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).","commonSituations":"ArcGIS error envelopes that still use HTTP 200; schema drift in the PortWatch hosted layer; unit tests feeding incomplete fixture dicts into transform_data.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"def is_chokepoint_geojson(payload) -> bool:\n    return isinstance(payload, dict) and isinstance(payload.get('features'), list)","tryCatchPattern":"except OpenBBError as e:\n    if 'No data found in the response' in str(e):\n        # endpoint returned 200 with an error envelope; backoff and retry once\n        await asyncio.sleep(5)\n        info = await obb.economy.imf.maritime_chokepoint_info()","preventionTips":["Shape-check raw ArcGIS payloads in custom integrations before reading 'features'","Treat 200-with-error-body as a known ArcGIS failure mode"],"tags":["imf","portwatch","arcgis","response-shape","no-data"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}