{"record":{"id":"c44e64b9ab78b2b9","repo":"OpenBB-finance/OpenBB","slug":"adjustment-can-only-be-applied-to-daily-1d-int","errorCode":null,"errorMessage":"Adjustment can only be applied to daily ('1d') interval.","messagePattern":"Adjustment can only be applied to daily \\('1d'\\) interval\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/fmp/openbb_fmp/models/equity_historical.py","lineNumber":48,"sourceCode":"    }\n\n    interval: Literal[\"1m\", \"5m\", \"15m\", \"30m\", \"1h\", \"4h\", \"1d\"] = Field(\n        default=\"1d\", description=QUERY_DESCRIPTIONS.get(\"interval\", \"\")\n    )\n    adjustment: Literal[\"splits_only\", \"splits_and_dividends\", \"unadjusted\"] = Field(\n        default=\"splits_only\",\n        description=\"Type of adjustment for historical prices. Only applies to daily data.\",\n    )\n\n    @model_validator(mode=\"before\")\n    @classmethod\n    def _validate_params(cls, values: dict) -> dict:\n        \"\"\"Validate query parameters.\"\"\"\n        interval = values.get(\"interval\", \"1d\")\n        adjustment = values.get(\"adjustment\", \"splits_only\")\n\n        if adjustment != \"splits_only\" and interval != \"1d\":\n            raise ValueError(\"Adjustment can only be applied to daily ('1d') interval.\")\n        return values\n\n\nclass FMPEquityHistoricalData(EquityHistoricalData):\n    \"\"\"FMP Equity Historical Price Data.\"\"\"\n\n    __alias_dict__ = {\n        \"open\": \"adjOpen\",\n        \"high\": \"adjHigh\",\n        \"low\": \"adjLow\",\n        \"close\": \"adjClose\",\n    }\n\n    change: float | None = Field(\n        default=None,\n        description=\"Change in the price from the previous close.\",\n    )\n    change_percent: float | None = Field(","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/fmp/openbb_fmp/models/equity_historical.py#L30-L66","documentation":"A Pydantic model_validator ValueError on FMPEquityHistoricalQueryParams: FMP only serves adjusted prices (adjustment='splits_only' is a no-op baseline) on the daily interval. If you request any other adjustment ('split', 'dividend', 'all') together with an intraday interval (anything other than '1d'), validation fails before any request is made.","triggerScenarios":"Calling obb.equity.price.historical(symbol=X, provider='fmp', interval='1m'|'1h'|..., adjustment='split') etc. The defaults (interval='1d', adjustment='splits_only') never trigger it; only a non-default adjustment paired with a non-daily interval does.","commonSituations":"Reusing query params built for daily data on an intraday call, UI defaults that always pass adjustment='all', or porting code from a provider (e.g. Yahoo) where intraday dividend/split adjustment was accepted.","solutions":["Drop the adjustment parameter for intraday requests (intraday data is unadjusted anyway)","Or switch interval to '1d' if you truly need adjusted prices","Catch the pydantic ValidationError client-side and report 'adjustment requires daily interval' to the caller"],"exampleFix":"# before\nres = obb.equity.price.historical(symbol='AAPL', provider='fmp', interval='1h', adjustment='all')  # ValueError\n\n# after\nres = obb.equity.price.historical(symbol='AAPL', provider='fmp', interval='1h')          # unadjusted intraday\n# or\nres = obb.equity.price.historical(symbol='AAPL', provider='fmp', interval='1d', adjustment='all')","handlingStrategy":"validation","validationCode":"interval, adjustment = '1h', 'all'\nif adjustment and adjustment != 'splits_only' and interval != '1d':\n    adjustment = None  # or raise, per your UX\n    # FMP only supports adjustment on daily bars","typeGuard":"def fmp_historical_params_ok(interval: str, adjustment: str | None) -> bool:\n    return adjustment in (None, 'splits_only') or interval == '1d'","tryCatchPattern":"from pydantic import ValidationError\ntry:\n    res = obb.equity.price.historical(symbol=s, provider='fmp', interval=i, adjustment=a)\nexcept ValidationError:\n    if a not in (None, 'splits_only') and i != '1d':\n        res = obb.equity.price.historical(symbol=s, provider='fmp', interval=i)  # drop adjustment\n    else:\n        raise","preventionTips":["Strip adjustment from parameter dicts when switching to intraday intervals","Keep provider-specific parameter rule tables (interval x adjustment) in one place","Remember adjustment='splits_only' is the safe default and never trips this validator"],"tags":["fmp","validation","historical-prices","interval","pydantic"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}