{"record":{"id":"9d62aa475b82422b","repo":"OpenBB-finance/OpenBB","slug":"measure-measure-not-supported-choose-from-usd","errorCode":null,"errorMessage":"Measure {measure} not supported. Choose from 'usd', 'local', or 'ratios'.","messagePattern":"Measure (.+?) not supported\\. Choose from 'usd', 'local', or 'ratios'\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/famafrench/openbb_famafrench/utils/helpers.py","lineNumber":732,"sourceCode":"\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    measure = measure.lower() if measure is not None else \"usd\"\n    data = get_international_portfolio_data(index, country, dividends)\n    tables = read_dat_file(data)\n    dataframes, metadata = process_international_portfolio_data(tables, dividends)\n\n    if measure and measure not in [\"usd\", \"local\", \"ratios\"]:\n        raise ValueError(\n            f\"Measure {measure} not supported. Choose from 'usd', 'local', or 'ratios'.\"\n        )\n\n    if frequency == \"monthly\" and measure == \"ratios\":\n        raise ValueError(\"Only annual frequency is available for 'ratios' measure.\")\n\n    if frequency:\n        dfs = [\n            df\n            for df, meta in zip(dataframes, metadata)\n            if meta[\"frequency\"] == frequency\n        ]\n        dfs_meta = [meta for meta in metadata if meta[\"frequency\"] == frequency]\n    else:\n        dfs = dataframes\n        dfs_meta = metadata\n\n    if measure == \"local\":","sourceCodeStart":714,"sourceCodeEnd":750,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/famafrench/openbb_famafrench/utils/helpers.py#L714-L750","documentation":"Raised by get_international_portfolio_data when `measure` is not one of 'usd', 'local', 'ratios' (after lowercasing; None defaults to 'usd'). Note the check runs AFTER the data has already been downloaded and parsed, so an invalid measure wastes a full fetch before failing.","triggerScenarios":"Calling international portfolio returns with measure='USD Returns', measure='euro', or any string outside the three allowed values.","commonSituations":"Assuming currency codes are accepted; passing user free-text input straight into the API; case is handled but whitespace is not (' usd' fails).","solutions":["Use exactly 'usd', 'local', or 'ratios' (case-insensitive).","Strip whitespace from user input before calling.","Validate the value client-side first — the server only validates after downloading, so early validation saves a round trip."],"exampleFix":"// before\nobb.economy.famafrench.international_index_returns(country='Japan', measure='JPY')\n\n// after\nobb.economy.famafrench.international_index_returns(country='Japan', measure='local')","handlingStrategy":"validation","validationCode":"measure = (measure or 'usd').strip().lower()\nassert measure in ('usd', 'local', 'ratios'), f\"measure must be usd|local|ratios, got {measure!r}\"","typeGuard":"def is_valid_intl_measure(m: str) -> bool:\n    return (m or 'usd').strip().lower() in ('usd', 'local', 'ratios')","tryCatchPattern":null,"preventionTips":["Normalize (strip + lower) measure client-side; the server lowercases but does not strip.","Validate before calling — the check runs only after a full download, so early checks save a fetch."],"tags":["famafrench","validation","measure"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}