{"record":{"id":"31103e1208de4090","repo":"OpenBB-finance/OpenBB","slug":"there-was-an-error-with-the-request-and-was-return-31103e","errorCode":null,"errorMessage":"There was an error with the request and was returned empty.","messagePattern":"There was an error with the request and was returned empty\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/fred/openbb_fred/models/university_of_michigan.py","lineNumber":119,"sourceCode":"        except Exception as e:\n            raise e from e\n\n        return {\n            \"metadata\": response.metadata,\n            \"data\": [d.model_dump() for d in response.result],\n        }\n\n    @staticmethod\n    def transform_data(\n        query: FredUofMichiganQueryParams, data: dict, **kwargs: Any\n    ) -> list[FredUofMichiganData]:\n        \"\"\"Transform data.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from pandas import DataFrame\n\n        df = DataFrame(data.get(\"data\", []))\n        if df.empty:\n            raise EmptyDataError(\n                \"There was an error with the request and was returned empty.\"\n            )\n        metadata = data.get(\"metadata\", {})\n        # Combine the legacy series with the new one.\n        if \"UMCSENT1\" in df.columns:\n            df[\"UMCSENT\"] = df[\"UMCSENT\"].fillna(df[\"UMCSENT1\"])\n            df = df.drop(columns=[\"UMCSENT1\"])\n            metadata.pop(\"UMCSENT1\", None)\n\n        # Normalize the percent values.\n        df[\"MICH\"] = df[\"MICH\"] / 100\n        if query.transform and query.transform not in [\"chg\", \"ch1\", \"log\"]:\n            df[\"UMCSENT\"] = df[\"UMCSENT\"] / 100\n\n        df = df.rename(\n            columns={\"UMCSENT\": \"consumer_sentiment\", \"MICH\": \"inflation_expectation\"}\n        )\n        records = (","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/fred/openbb_fred/models/university_of_michigan.py#L101-L137","documentation":"Raised in FredUofMichiganFetcher.transform_data (openbb_fred/models/university_of_michigan.py:119) when the DataFrame of observations from the delegated FredSeriesFetcher is empty. The consumer sentiment series (UMCSENT/UMCSENT1, MICH, etc.) are fetched then merged and normalized; empty input means the upstream series request returned nothing, usually rate limiting, invalid key, or a date range outside coverage.","triggerScenarios":"Calling economy/fred university-of-michigan while rate limited; start_date in the future; the legacy UMCSENT/UMCSENT1 series both empty for the window.","commonSituations":"Bundled FRED batch jobs hitting the request cap; recent-month requests before the preliminary sentiment print is published on FRED.","solutions":["Retry after 60 seconds (rate limiting).","Set end_date to a published date or clear the date filters.","Verify UMCSENT via fred_series to confirm availability."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"from openbb_core.provider.utils.errors import EmptyDataError\n\ntry:\n    res = obb.economy.fred.university_of_michigan(start_date=s, end_date=e)\nexcept EmptyDataError:\n    res = obb.economy.fred.university_of_michigan()","preventionTips":["Cap end_date at the last published month; preliminary prints lag realtime.","Cache monthly - the series updates once per month."],"tags":["fred","sentiment","empty-data","rate-limit"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}