OpenBB-finance/OpenBB · error · ValueError
Invalid transform: {t}. Available transforms are: {', '.join
Error message
Invalid transform: {t}. Available transforms are: {', '.join(valid_transforms)} What it means
Error "Invalid transform: {t}. Available transforms are: {', '.join(valid_transforms)}" thrown in OpenBB-finance/OpenBB.
Source
Thrown at openbb_platform/providers/fred/openbb_fred/models/consumer_price_index.py:52
def validate_country(cls, c: str):
"""Validate country."""
result: list = []
values = c.replace(" ", "_").split(",")
for v in values:
if v.lower() not in CPI_COUNTRIES:
raise ValueError(
f"Invalid country: {v}. Available countries are: {', '.join(CPI_COUNTRIES)}"
)
result.append(v.lower())
return ",".join(result)
@field_validator("transform", mode="before", check_fields=False)
@classmethod
def validate_transform(cls, t: str):
"""Validate transform."""
valid_transforms = ["index", "yoy", "period"]
if t.lower() not in valid_transforms:
raise ValueError(
f"Invalid transform: {t}. Available transforms are: {', '.join(valid_transforms)}"
)
return t.lower()
class FREDConsumerPriceIndexData(ConsumerPriceIndexData):
"""FRED Consumer Price Index Data."""
class FREDConsumerPriceIndexFetcher(
Fetcher[FREDConsumerPriceIndexQueryParams, list[FREDConsumerPriceIndexData]]
):
"""Transform the query, extract and transform the data from the FRED endpoints."""
@staticmethod
def transform_query(params: dict[str, Any]) -> FREDConsumerPriceIndexQueryParams:
"""Transform query."""
return FREDConsumerPriceIndexQueryParams(**params)View on GitHub (pinned to 3e071fcc2c)
Solutions
- Choose a transform from the listed available transforms.
- Omit the transform parameter to use the default.
When it happens
Trigger: Thrown at openbb_platform/providers/fred/openbb_fred/models/consumer_price_index.py:52 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/bca28364b5f0582f.
Report an issue: GitHub.