{"record":{"id":"ee34ee9f17196113","repo":"OpenBB-finance/OpenBB","slug":"no-valid-values-for-dimension-dim-id-given-con","errorCode":null,"errorMessage":"No valid values for dimension '{dim_id}' given constraints. Table indicator codes: {codes}available for {prior_selections}: {sorted(available_values)}","messagePattern":"No valid values for dimension '(.+?)' given constraints\\. Table indicator codes: (.+?)available for (.+?): (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/utils/table_builder.py","lineNumber":740,"sourceCode":"                        # Check if URL would be too long\n                        joined_codes = \"+\".join(filtered_codes)\n                        if len(joined_codes) > 1500:\n                            fetch_kwargs[dim_id] = \"*\"\n                            if \"_indicator_codes_to_filter\" not in fetch_kwargs:\n                                fetch_kwargs[\"_indicator_codes_to_filter\"] = set()\n                            fetch_kwargs[\"_indicator_codes_to_filter\"].update(\n                                filtered_codes\n                            )\n                        else:\n                            fetch_kwargs[dim_id] = joined_codes\n                    else:\n                        # No valid codes - this dimension has no data for given constraints\n                        prior_selections = {\n                            d: fetch_kwargs.get(d) or normalized_kwargs.get(d)\n                            for d in dims_in_order\n                            if fetch_kwargs.get(d) or normalized_kwargs.get(d)\n                        }\n                        raise ValueError(\n                            f\"No valid values for dimension '{dim_id}' given constraints. \"\n                            f\"Table indicator codes: {codes}\"\n                            f\"available for {prior_selections}: {sorted(available_values)}\"\n                        )\n\n        except (KeyError, ValueError) as e:\n            # Check if this is a validation error - don't suppress those\n            error_msg = str(e)\n            if (\n                \"Invalid value(s) for dimension\" in error_msg\n                or \"not compatible with dataflow\" in error_msg\n            ):\n                raise ValueError(error_msg) from e\n            # Fallback: use all codes if progressive validation fails\n            warnings.warn(\n                f\"Progressive constraint filtering failed: {e}. Using unfiltered codes.\",\n                OpenBBWarning,\n            )","sourceCodeStart":722,"sourceCodeEnd":758,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/utils/table_builder.py#L722-L758","documentation":"Raised when a non-standard-order dimension (not in dims_in_order) has hierarchy codes, none of which appear in the dimension's available options after filtering - i.e. zero intersection between the table's codes and available values under current constraints. The message lists both sets so the user can see there is no overlap.","triggerScenarios":"Fetching a table where an auxiliary dimension (e.g. a counterpart or classification dimension outside the standard order) has codes defined, but every one of them is absent from available options for the current country/table combination; occurs in the post-loop handling of dimension_codes not in dims_in_order.","commonSituations":"Regional aggregates queried with codes only valid for bilateral data; stale table definitions referencing retired classification codes; tables whose extra dimensions are country-specific.","solutions":["Relax the constraining earlier selections (usually country) to one where the dimension has data.","Use '*' for the constraining dimension and filter results client-side.","Pick codes from the 'available for ...' list in the error text instead of the table defaults.","Refresh provider caches/metadata if availability appears incorrect."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# For auxiliary dimensions, confirm at least one table code is available before fetching\navail = {opt['value'] for opt in builder.get_options_for_dimension(dim_id)}\nif not (set(table_codes) & avail):\n    widen_constraints()  # e.g. set COUNTRY='*' and filter client-side","typeGuard":null,"tryCatchPattern":"try:\n    res = obb.economy.imf.fetch(...)\nexcept ValueError as e:\n    if 'No valid values for dimension' in str(e):\n        params[constraining_dim] = '*'  # retry once with relaxed constraint\n        res = obb.economy.imf.fetch(dataset=ds, parameters=params)\n    else:\n        raise","preventionTips":["Relax the constraining dimension rather than dropping the fetch","For aggregates, expect auxiliary dimension codes to be sparse","Cache per-table availability to skip known-empty combos"],"tags":["imf","no-data","dimension-filter","valueerror"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}