{"record":{"id":"a66aebcb2843c886","repo":"OpenBB-finance/OpenBB","slug":"series-type-cannot-be-empty","errorCode":null,"errorMessage":"series_type cannot be empty.","messagePattern":"series_type cannot be empty\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/federal_reserve/openbb_federal_reserve/models/svensson_yield_curve.py","lineNumber":198,"sourceCode":"        \"Used to filter columns after fetching.\",\n    )\n    start_date: dateType | None = Field(\n        default=None,\n        description=QUERY_DESCRIPTIONS.get(\"start_date\", \"\")\n        + \" Used to filter results after fetching.\",\n    )\n    end_date: dateType | None = Field(\n        default=None,\n        description=QUERY_DESCRIPTIONS.get(\"end_date\", \"\")\n        + \" Used to filter results after fetching.\",\n    )\n\n    @field_validator(\"series_type\")\n    @classmethod\n    def _validate_series_type(cls, v):\n        \"\"\"Validate series_type field.\"\"\"\n        if not v:\n            raise ValueError(\"series_type cannot be empty.\")\n\n        series_list = v.split(\",\") if isinstance(v, str) else v\n        series_list = [v.strip().lower() for v in series_list]\n\n        if \"all\" in series_list:\n            return \"all\"\n\n        valid_options = get_args(SERIES_TYPE)\n\n        for series in series_list:\n            if series not in valid_options:\n                raise ValueError(\n                    f\"Invalid series_type: {series} -> Valid options are: {valid_options}\"\n                )\n\n        return \",\".join(series_list)\n\n","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/federal_reserve/openbb_federal_reserve/models/svensson_yield_curve.py#L180-L216","documentation":"A Pydantic field_validator error from FederalReserveSvenssonQueryParams: the series_type parameter was falsy — empty string, empty list, or None after defaults — so validation fails before any network call. It exists to force the caller to explicitly pick which Svensson series (or 'all') to request.","triggerScenarios":"Instantiating FederalReserveSvenssonQueryParams (or obb.economy.svensson_yield_curve) with series_type='' or omitting it while a wrapper overwrites it with an empty value; passing an empty list programmatically.","commonSituations":"Programmatic callers building params from user input where the series_type field is left blank; a wrapper defaulting the field to '' instead of 'all'.","solutions":["Pass a valid value: 'all' or a comma-separated subset of the SERIES_TYPE options (e.g. 'zero_coupon_yields,par_yields').","If the field is optional in your UI, default it to 'all' before calling the API.","Validate non-empty input client-side before constructing the QueryParams."],"exampleFix":"// before\nparams = FederalReserveSvenssonQueryParams(series_type=user_input)  # user_input = ''\n// after\nparams = FederalReserveSvenssonQueryParams(series_type=user_input or 'all')","handlingStrategy":"validation","validationCode":"series_type = (series_type or '').strip() or 'all'\nparams = FederalReserveSvenssonQueryParams(series_type=series_type)","typeGuard":"def is_valid_series_input(v) -> bool:\n    return bool(v and v.strip())","tryCatchPattern":"try:\n    FederalReserveSvenssonQueryParams(series_type=s)\nexcept ValidationError as e:\n    s = 'all'","preventionTips":["Default optional series_type fields to 'all'","Strip and reject blank input before constructing QueryParams"],"tags":["openbb","validation","pydantic","yield-curve"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}