{"record":{"id":"0997570010fe6a1a","repo":"OpenBB-finance/OpenBB","slug":"maturity-must-be-a-float-or-a-comma-separated-stri","errorCode":null,"errorMessage":"maturity must be a float or a comma-separated string of floats","messagePattern":"maturity must be a float or a comma-separated string of floats","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/fred/openbb_fred/utils/fred_helpers.py","lineNumber":219,"sourceCode":"    \"slovak_republic\",\n    \"slovakia\",\n    \"slovenia\",\n    \"south_africa\",\n    \"spain\",\n    \"sweden\",\n    \"switzerland\",\n    \"turkey\",\n    \"united_kingdom\",\n    \"united_states\",\n]\n\n\ndef comma_to_float_list(v: str) -> list[float]:\n    \"\"\"Convert comma-separated string to list of floats.\"\"\"\n    try:\n        return [float(m) for m in v.split(\",\")]\n    except ValueError as e:\n        raise OpenBBError(\n            \"maturity must be a float or a comma-separated string of floats\"\n        ) from e\n\n\ndef all_cpi_options(harmonized: bool = False) -> list[dict]:\n    \"\"\"Get all CPI options.\"\"\"\n    data = []\n\n    current_dir = os.path.dirname(os.path.realpath(__file__))\n    file = \"harmonized_cpi.csv\" if harmonized else \"cpi.csv\"\n\n    with open(Path(current_dir, file), encoding=\"utf-8\") as csv_file_handler:\n        csv_reader = csv.DictReader(csv_file_handler)\n        for rows in csv_reader:\n            row = {key.lstrip(\"\\ufeff\"): value for key, value in rows.items()}\n            data.append(row)\n    return data\n","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/fred/openbb_fred/utils/fred_helpers.py#L201-L237","documentation":"Error \"maturity must be a float or a comma-separated string of floats\" thrown in OpenBB-finance/OpenBB.","triggerScenarios":"Thrown at openbb_platform/providers/fred/openbb_fred/utils/fred_helpers.py:219 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass maturity as a float (e.g., 3.5) or a comma-separated string of floats (e.g., '1,3,6').","Remove any non-numeric characters from the maturity value."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}