{"record":{"id":"29a05dd630a30c38","repo":"OpenBB-finance/OpenBB","slug":"invalid-transform-value-query-transform-for-da","errorCode":null,"errorMessage":"Invalid transform value '{query.transform}' for dataflow '{dataflow}'. Available options: {', '.join(available) if available else 'none'}","messagePattern":"Invalid transform value '(.+?)' for dataflow '(.+?)'\\. Available options: (.+?)","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/models/economic_indicators.py","lineNumber":773,"sourceCode":"                # Raise error if transform value is not valid for dataflow\n                if not applied:\n                    available = []\n                    if transform_lookup:\n                        available.extend(\n                            sorted(\n                                set(transform_lookup.keys())\n                                - set(transform_lookup.values())\n                            )\n                        )\n                    if unit_lookup:\n                        available.extend(\n                            sorted(set(unit_lookup.keys()) - set(unit_lookup.values()))\n                        )\n                    if not transform_dim and not unit_dim:\n                        raise OpenBBError(\n                            f\"Dataflow '{dataflow}' does not support transform/unit parameter.\"\n                        )\n                    raise OpenBBError(\n                        f\"Invalid transform value '{query.transform}' for dataflow '{dataflow}'. \"\n                        f\"Available options: {', '.join(available) if available else 'none'}\"\n                    )\n\n            # We request one extra period to ensure value carry-forward for STATUS=\"NA\" obs.\n            if query.limit is not None and start_date is None:\n                current_year = datetime.now().year\n                if frequency == \"A\":\n                    start_year = current_year - query.limit - 1\n                    start_date = str(start_year)  # Just year for annual\n                elif frequency == \"Q\":\n                    years_back = (query.limit + 7) // 4 + 1\n                    start_year = current_year - years_back\n                    start_date = str(start_year)\n                elif frequency == \"M\":\n                    years_back = (query.limit + 23) // 12 + 1\n                    start_year = current_year - years_back\n                    start_date = str(start_year)","sourceCodeStart":755,"sourceCodeEnd":791,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/models/economic_indicators.py#L755-L791","documentation":"Raised by the IMF economic_indicators fetcher when the caller supplies a `transform` value that the requested SDMX dataflow does not expose as a valid TRANSFORM (or UNIT) dimension value. The fetcher inspects the dataflow's dimension codelists and, before querying, verifies that the requested transform maps onto an actual dimension code; if not, it aborts with the list of transforms/units the dataflow actually accepts (or 'none'). This is a fail-fast validation so the IMF API does not silently ignore the transform.","triggerScenarios":"Calling `economic_indicators(..., transform='pcp')` (or any transform string) with `indicator`/`table` set to a dataflow whose SDMX structure has no TRANSFORM dimension, or whose codelist lacks the given code. Only hit in the single-dataflow code path (table mode or one indicator) where transform_dim/unit_dim lookup fails and `available` is populated.","commonSituations":"Copy-pasting a transform (e.g. 'yoy', 'pcp') that worked for one IMF dataflow (like the IFS main tables) onto another dataflow with a different structure; upgrading the provider after IMF renames codelist codes; passing a unit string in the `transform` parameter.","solutions":["Read the error message: use one of the transforms listed after 'Available options:' for that exact dataflow.","Drop the `transform` parameter entirely to fetch raw values for that dataflow.","Check the dataflow's codelist via the IMF SDMX structure endpoint or the provider's `transform_lookup` to confirm supported codes before calling.","If you need a specific transform (e.g. year-over-year), compute it from the raw series locally instead."],"exampleFix":"# before\neconomic_indicators(indicator='NGDP_RPCH', transform='growth')\n\n# after\neconomic_indicators(indicator='NGDP_RPCH')  # transform unsupported; use listed options only","handlingStrategy":"validation","validationCode":"from openbb_imf.models.economic_indicators import get_transform_options  # if exposed; else query structure first\n# Generic pre-check: fetch the dataflow structure and confirm the transform code exists\nasync def transform_supported(dataflow: str, transform: str) -> bool:\n    # inspect the provider's transform_lookup for the dataflow, or call the IMF\n    # SDMX structure endpoint and look for TRANSFORM codelist membership\n    codes = await fetch_transform_codelist(dataflow)  # your helper\n    return transform in codes","typeGuard":null,"tryCatchPattern":"try:\n    res = await obb.economy.imf.economic_indicators(indicator=ind, transform=t)\nexcept OpenBBError as e:\n    if 'Invalid transform value' in str(e):\n        res = await obb.economy.imf.economic_indicators(indicator=ind)  # retry raw\n    else:\n        raise","preventionTips":["Treat transforms as per-dataflow, not global constants","Read the 'Available options' list from the error and cache it per dataflow","Compute derived transforms locally when portability matters"],"tags":["imf","sdmx","validation","query-params"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}