{"record":{"id":"c5fbdf90284df5b2","repo":"OpenBB-finance/OpenBB","slug":"period-query-period-not-supported","errorCode":null,"errorMessage":"Period '{query.period}' not supported.","messagePattern":"Period '(.+?)' not supported\\.","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/intrinio/openbb_intrinio/models/cash_flow.py","lineNumber":267,"sourceCode":"    def transform_query(params: dict[str, Any]) -> IntrinioCashFlowStatementQueryParams:\n        \"\"\"Transform the query params.\"\"\"\n        return IntrinioCashFlowStatementQueryParams(**params)\n\n    @staticmethod\n    async def aextract_data(\n        query: IntrinioCashFlowStatementQueryParams,\n        credentials: dict[str, str] | None,\n        **kwargs: Any,\n    ) -> list[dict]:\n        \"\"\"Return the raw data from the Intrinio endpoint.\"\"\"\n        api_key = credentials.get(\"intrinio_api_key\") if credentials else \"\"\n        statement_code = \"cash_flow_statement\"\n        if query.period in [\"quarter\", \"annual\"]:\n            period_type = \"FY\" if query.period == \"annual\" else \"QTR\"\n        elif query.period in [\"ttm\", \"ytd\"]:\n            period_type = query.period.upper()\n        else:\n            raise OpenBBError(f\"Period '{query.period}' not supported.\")\n\n        base_url = \"https://api-v2.intrinio.com\"\n        fundamentals_url = (\n            f\"{base_url}/companies/{query.symbol}\"\n            f\"/fundamentals?statement_code={statement_code}&type={period_type}\"\n        )\n        if query.fiscal_year is not None:\n            if query.fiscal_year < 2008:\n                warn(\"Financials data is only available from 2008 and later.\")\n                query.fiscal_year = 2008\n            fundamentals_url = fundamentals_url + f\"&fiscal_year={query.fiscal_year}\"\n        fundamentals_url = fundamentals_url + f\"&api_key={api_key}\"\n        fundamentals_data = (await get_data_one(fundamentals_url, **kwargs)).get(\n            \"fundamentals\", []\n        )\n\n        fiscal_periods = [\n            f\"{item['fiscal_year']}-{item['fiscal_period']}\"","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/intrinio/openbb_intrinio/models/cash_flow.py#L249-L285","documentation":"Input validation in the Intrinio cash-flow fetcher: only quarter, annual, ttm, and ytd periods are mapped to Intrinio's fundamentals 'type' parameter (QTR/FY/TTM/YTD). Any other period string reaches the else branch and raises OpenBBError before any HTTP request is made.","triggerScenarios":"Calling obb.equity.cash-flow(provider='intrinio', period='monthly') or any non-standard value ('semi-annual', 'q', 'year', typo like 'anual'). The fetcher maps period to period_type and raises when no mapping exists.","commonSituations":"Copy-pasting period values valid for other providers (e.g. 'quarterly' with the -ly suffix); older scripts written when a different period vocabulary was accepted; UI dropdowns offering periods this provider does not support.","solutions":["Use one of: 'quarter', 'annual', 'ttm', 'ytd'.","Check the query param model/annotation for IntrinioCashFlowStatementQueryParams to see accepted values before calling.","If you need a period Intrinio doesn't offer, fetch 'quarter' and aggregate client-side."],"exampleFix":"# before\nobb.equity.cash_flow(provider='intrinio', symbol='AAPL', period='quarterly')\n# after\nobb.equity.cash_flow(provider='intrinio', symbol='AAPL', period='quarter')","handlingStrategy":"validation","validationCode":"ALLOWED = {'quarter', 'annual', 'ttm', 'ytd'}\nperiod = period.lower().strip()\nif period not in ALLOWED:\n    period = {'quarterly': 'quarter', 'yearly': 'annual', 'year': 'annual'}.get(period, 'quarter')\n\nobb.equity.cash_flow(provider='intrinio', symbol=sym, period=period)","typeGuard":"def is_supported_period(p: str) -> bool:\n    return p in {'quarter', 'annual', 'ttm', 'ytd'}","tryCatchPattern":"from openbb_core.app.model.abstract.error import OpenBBError\ntry:\n    res = obb.equity.cash_flow(provider='intrinio', symbol=sym, period=period)\nexcept OpenBBError as e:\n    if 'not supported' in str(e):\n        res = obb.equity.cash_flow(provider='intrinio', symbol=sym, period='quarter')\n    else:\n        raise","preventionTips":["Whitelist period values per provider before calling","Normalize '-ly' suffixes ('quarterly'->'quarter')","Aggregate quarterly data client-side for custom periods"],"tags":["intrinio","parameter-validation","cash-flow","openbberror"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}