{"record":{"id":"6af8809d331afdff","repo":"OpenBB-finance/OpenBB","slug":"frequency-frequency-not-supported-choose-from","errorCode":null,"errorMessage":"Frequency {frequency} not supported. Choose from 'monthly', 'annual', or 'daily'.","messagePattern":"Frequency (.+?) not supported\\. Choose from 'monthly', 'annual', or 'daily'\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/famafrench/openbb_famafrench/utils/helpers.py","lineNumber":810,"sourceCode":"        If None, defaults to 'monthly'.\n    measure : Optional[str]\n        The measure of the data to return.\n        Can be 'value', 'equal', 'number_of_firms', or 'firm_size'.\n        If None, defaults to 'value'.\n\n    Returns\n    -------\n    tuple\n        A tuple containing a list of pandas DataFrames and a list of metadata dictionaries.\n        In most scenarios, there will only be 1 DataFrame and 1 metadata dictionary.\n\n    Raises\n    ------\n    ValueError\n        When an invalid combination of parameters or unsupported values are supplied.\n    \"\"\"\n    if frequency and frequency.lower() not in [\"monthly\", \"annual\", \"daily\"]:\n        raise ValueError(\n            f\"Frequency {frequency} not supported. Choose from 'monthly', 'annual', or 'daily'.\"\n        )\n    if measure and measure not in [\"value\", \"equal\", \"number_of_firms\", \"firm_size\"]:\n        raise ValueError(\n            f\"Measure {measure} not supported. \"\n            + \"Choose from 'value', 'equal', 'number_of_firms', or 'firm_size'.\"\n        )\n    if measure in [\"number_of_firms\", \"firm_size\"] and frequency == \"annual\":\n        raise ValueError(\n            f\"Measure '{measure}' is only available for monthly frequency.\"\n        )\n    if \"Factor\" in dataset:\n        measure = None\n\n    file = download_file(dataset)\n    table, desc = read_csv_file(file)\n    dfs, metadata = process_csv_tables(table, desc)\n","sourceCodeStart":792,"sourceCodeEnd":828,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/famafrench/openbb_famafrench/utils/helpers.py#L792-L828","documentation":"Raised by the US research-portfolios helper when `frequency` (after lowercasing) is not 'monthly', 'annual', or 'daily'. Plain client-side validation performed before any download, unlike the international variant.","triggerScenarios":"Calling a US portfolio famafrench endpoint with frequency='weekly', 'quarterly', 'M', or any other token.","commonSituations":"Mapping another API's frequency vocabulary (Q/W/M from FRED-style codes) onto this endpoint; user free-text passed through unvalidated.","solutions":["Use 'monthly', 'annual', or 'daily' only.","Normalize frequency strings (lowercase, strip) in your own layer before calling.","Check the endpoint's OpenAPI parameter choices for the accepted enum."],"exampleFix":"// before\nobb.economy.famafrench.us_portfolio_returns(frequency='quarterly')\n\n// after\nobb.economy.famafrench.us_portfolio_returns(frequency='annual')","handlingStrategy":"validation","validationCode":"freq = (frequency or '').strip().lower()\nassert freq in ('monthly', 'annual', 'daily'), f'unsupported frequency: {frequency!r}'","typeGuard":"def is_valid_ff_frequency(f: str) -> bool:\n    return (f or '').strip().lower() in ('monthly', 'annual', 'daily')","tryCatchPattern":null,"preventionTips":["Map external frequency vocabularies (FRED Q/M/W codes) to these three tokens in an adapter layer.","Drive user choices from the endpoint's OpenAPI enum rather than free text."],"tags":["famafrench","validation","frequency"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}