OpenBB-finance/OpenBB · error · ValueError
No data available: Table indicator codes do not match…
Error message
No data available: Table indicator codes do not match available data for dimension '{dim_id}'. Table has indicators: {codes}but given {prior_selections}, available indicators are: {available_values} What it means
Raised when the table's indicator codes are valid in principle, but after applying the user's prior constraints (country, counterpart area, etc.) the intersection with actually-available data for the indicator dimension is empty. The builder explicitly names the table's indicators versus what is actually available so the user can see the mismatch.
Solutions
- Drop or change the prior constraint (usually COUNTRY) to one that reports the indicators listed in the message.
- Switch to one of the 'available indicators' the error enumerates instead of the table's default set.
- Request the parent/wider hierarchy (use '*' for the dimension) and post-filter locally.
- If availability looks wrong, refresh metadata caches - the availability snapshot may be stale.
Example fix
# before
res = obb.economy.imf.fetch(dataset='BOP', parameters={'COUNTRY': 'TOT', 'BOP_ACCOUNTING_ENTRY': 'N'})
# after - use an accounting entry the country actually reports (per the error's list)
res = obb.economy.imf.fetch(dataset='BOP', parameters={'COUNTRY': 'TOT', 'BOP_ACCOUNTING_ENTRY': 'C'}) Defensive patterns
Strategy: validation
Validate before calling
# Probe availability for the country before the full fetch
probe = obb.economy.imf.fetch(dataset='BOP', parameters={'COUNTRY': country, 'INDICATOR': '*'}, limit=1)
if not probe.results:
skip(country) # this country/table combo has no matching indicators Try / catch
try:
res = obb.economy.imf.fetch(...)
except ValueError as e:
if 'Table indicator codes do not match available data' in str(e):
continue # expected for non-reporting countries in batch loops
raise Prevention
- For country loops, probe with '*' and limit=1 before the full request
- Maintain a per-country capability map from prior fetches
- Treat this as expected empty-data, not a bug, in batch pipelines
When it happens
Trigger: Querying a table whose indicator dimension has codes, but for which the builder, after progressive constraint filtering against a specific country/period, finds zero matching codes - e.g. a BOP table queried for a country that only reports a different accounting series. Raised in the elif branch handling dimensions with hierarchy codes.
Common situations: Small economies or non-reporting countries missing certain series; querying composite/Net indicators where only Credit/Debit exist; combining a country with an indicator family that nation does not report; stale hierarchy metadata claiming codes that no longer exist.
Related errors
- No valid values for dimension
- {error_msg}
- Error serializing output for an extension-modified endpoint
- Invalid value(s) for dimension
- Invalid value(s) for dimension
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/0b7d91290a67c293.
Report an issue: GitHub.
Appendix: source
Thrown at openbb_platform/providers/imf/openbb_imf/utils/table_builder.py:646
if len(constraint_key) > MAX_CODES_LENGTH:
constraint_key = "*"
else:
constraint_key = joined_codes
builder_key = user_override if user_override else constraint_key
builder.set_dimension((dim_id, builder_key))
else:
# No codes available for this dimension given prior constraints
# This means the table's indicators don't exist for this country/period
empty_dimensions.append(dim_id)
# Build context for error message
prior_selections = {
d: normalized_kwargs.get(d)
for d in dims_in_order
if d in normalized_kwargs
and dims_in_order.index(d) < dims_in_order.index(dim_id)
}
raise ValueError(
f"No data available: Table indicator codes do not match "
f"available data for dimension '{dim_id}'. "
f"Table has indicators: {codes}"
f"but given {prior_selections}, "
f"available indicators are: {available_values}"
)
# If ALL indicator dimensions had zero matches, the hierarchy doesn't apply
indicator_dims_set = {"INDICATOR", "BOP_ACCOUNTING_ENTRY", "SERIES", "ITEM"}
missing_indicator_dims = [
d for d in empty_dimensions if d in indicator_dims_set
]
expected_indicator_dims = [
d for d in dims_in_order if d in indicator_dims_set
]
unmapped_indicator_dims = [
d
for d in expected_indicator_dimsView on GitHub (pinned to 3e071fcc2c)