OpenBB-finance/OpenBB · error · ValueError
Dataflow '{dataflow_id}' not found.
Error message
Dataflow '{dataflow_id}' not found. What it means
Raised by get_dataflow_parameters when the requested dataflow_id is not a key in the loaded dataflows catalog. This method backs the query builders (e.g. IMTS parameter lookup in dot_helpers) and needs the dataflow's DSD to enumerate dimension values, so an unknown ID fails immediately with the offending ID echoed.
Source
Thrown at openbb_platform/providers/imf/openbb_imf/utils/metadata.py:394
break
if include:
filtered_results.append(indicator)
# Clean up internal search field before returning
for indicator in filtered_results:
indicator.pop("_table_search_text", None)
return filtered_results
def _parse_query(self, query: str) -> list[list[str]]:
"""Parse a search query string into OR-groups of AND-terms."""
return parse_search_query(query)
def get_dataflow_parameters(self, dataflow_id: str) -> dict[str, list[dict]]:
"""Get available parameters for a given dataflow."""
if dataflow_id not in self.dataflows:
raise ValueError(f"Dataflow '{dataflow_id}' not found.")
if (
hasattr(self, "_dataflow_parameters_cache")
and dataflow_id in self._dataflow_parameters_cache
):
return self._dataflow_parameters_cache[dataflow_id]
df_obj = self.dataflows[dataflow_id]
agency_id = df_obj.get("agencyID")
dsd_id = df_obj.get("structureRef", {}).get("id")
dsd = self.datastructures.get(dsd_id, {})
if not dsd:
return {}
dimensions_metadata = {
dim["id"]: dim for dim in dsd.get("dimensions", []) if dim.get("id")
}
View on GitHub (pinned to 3e071fcc2c)
Solutions
- Check the exact ID via list(meta.dataflows.keys()) or search_dataflows and use it verbatim.
- Normalize IDs to the catalog's casing (typically upper-case) before calling.
- If the catalog is empty or stale, rebuild the metadata object / update openbb-imf so the catalog refreshes.
Example fix
# before
params = meta.get_dataflow_parameters('imts')
# after
df_id = next(d for d in meta.dataflows if d.upper() == 'IMTS')
params = meta.get_dataflow_parameters(df_id) Defensive patterns
Strategy: validation
Validate before calling
df_id = df_id.strip().upper()
if df_id not in meta.dataflows:
raise ValueError(f'Unknown dataflow {df_id!r}. Valid: {sorted(meta.dataflows)[:10]} ...')
params = meta.get_dataflow_parameters(df_id) Type guard
def is_known_dataflow(df_id: str | None, catalog: dict) -> bool:
return isinstance(df_id, str) and df_id in catalog Try / catch
try:
params = meta.get_dataflow_parameters(df_id)
except ValueError as e:
if 'not found' in str(e):
df_id = next(d for d in meta.dataflows if df_id.upper() in d.upper())
params = meta.get_dataflow_parameters(df_id)
else:
raise Prevention
- Look up IDs from meta.dataflows.keys() once and cache them.
- Treat dataflow IDs as case-sensitive exact strings.
- Refresh the catalog when IMF revises the registry.
When it happens
Trigger: get_dataflow_parameters('IMT') (typo), lowercase 'imts' where the catalog keys are uppercase, or an ID from a different agency/version that the loaded catalog does not contain.
Common situations: Hard-coded dataflow IDs that bit-rot after IMF catalog revisions; case-sensitive lookups after user input normalization; partially loaded metadata after a network failure during initialization.
Related errors
- Invalid {name}(s): {', '.join(invalid)}
- Invalid indicator code(s) for dataflow '{dataflow}': {'; '.j
- No valid dataflows found to search indicators in.This might
- Data structure not found for dataflow '{dataflow_id}'.
- Dataflow '{dataflow_id}' not found. Available dataflows: {li
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/46106cf9166fdcd5.
Report an issue: GitHub.