{"record":{"id":"ac79edb4e15bbc1c","repo":"OpenBB-finance/OpenBB","slug":"the-request-was-returned-empty-this-may-be-due-to-ac79ed","errorCode":null,"errorMessage":"The request was returned empty. This may be due to an invalid, or incorrectly mapped, portfolio choice.","messagePattern":"The request was returned empty\\. This may be due to an invalid, or incorrectly mapped, portfolio choice\\.","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/famafrench/openbb_famafrench/models/international_index_returns.py","lineNumber":250,"sourceCode":"                ),\n            )\n        except Exception as e:  # pylint: disable=broad-except\n            raise OpenBBError(e) from e\n\n    @staticmethod\n    def transform_data(\n        query: FamaFrenchInternationalIndexReturnsQueryParams,\n        data: tuple,\n        **kwargs: Any,\n    ) -> AnnotatedResult[list[FamaFrenchInternationalIndexReturnsData]]:\n        \"\"\"Transform the extracted data.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from pandas import MultiIndex\n\n        dfs, meta = data\n\n        if not dfs:\n            raise OpenBBError(\n                \"The request was returned empty.\"\n                + \" This may be due to an invalid, or incorrectly mapped, portfolio choice.\"\n            )\n        returns_data = dfs[0] if isinstance(dfs, list) else dfs\n\n        # Values of -99.99  or -999 indicate no data,\n        # Drop columns that have no data.\n        for col in returns_data.columns:\n            if all(returns_data[col].values == \"-99.99\") or all(\n                returns_data[col].values == \"-999\"\n            ):\n                returns_data = returns_data.drop(columns=[col])\n            else:\n                returns_data[col] = (\n                    returns_data[col].astype(int)\n                    if query.measure == \"ratios\" and col == \"firms\"\n                    else returns_data[col].astype(float)\n                )","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/famafrench/openbb_famafrench/models/international_index_returns.py#L232-L268","documentation":"Thrown by FamaFrenchInternationalIndexReturns.transform_data when the zip archive downloaded from the Fama/French library contained no parseable DataFrames for the requested international index or country portfolio. The fetcher returned an empty list, so transform refuses to continue. It is an OpenBBError wrapping a plain empty-result condition, not a network failure.","triggerScenarios":"Calling obb.economy.famafrench.international_index_returns (international portfolios endpoint) with an index/country whose dataset is valid enough to download but whose .dat tables yield zero DataFrames after processing, or when the source zip is empty/restructured.","commonSituations":"Passing a portfolio label that maps to a file the upstream site no longer populates; upstream Fama/French data layout changes breaking process_international_portfolio_data; requesting a dataset whose tables are all dropped as no-data (-99.99/-999 sentinel) columns.","solutions":["Retry with a well-known index/country (e.g. 'Developed', 'Japan') to confirm the endpoint works at all.","Verify the index value against INTERNATIONAL_INDEX_PORTFOLIO_FILES / COUNTRY_PORTFOLIO_FILES keys in openbb_famafrench/utils/helpers.py.","Download the underlying zip directly from the Fama/French international portfolios URL and inspect its contents to see whether the dataset is empty upstream.","If upstream changed format, open an issue/PR against the openbb_famafrench provider."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from openbb_core.provider.standard_errors import EmptyDataError\ntry:\n    res = obb.economy.famafrench.international_index_returns(country='Japan')\nexcept EmptyDataError:\n    res = None\nexcept OpenBBError as e:\n    if 'returned empty' in str(e):\n        res = None\n    else:\n        raise","preventionTips":["Validate index/country against INTERNATIONAL_INDEX_PORTFOLIO_FILES / COUNTRY_PORTFOLIO_FILES before calling.","Treat empty results as a normal outcome and cache successful responses to reduce refetches."],"tags":["famafrench","empty-data","international-portfolios"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}