{"record":{"id":"c5f6a5a9088b194f","repo":"OpenBB-finance/OpenBB","slug":"invalid-amendment-type-values-amendment-type-m","errorCode":null,"errorMessage":"Invalid amendment_type: {values.amendment_type}. Must be one of: {', '.join(AmendmentTypes)}.","messagePattern":"Invalid amendment_type: (.+?)\\. Must be one of: (.+?)\\.","errorType":"validation","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/congress_gov/openbb_congress_gov/models/congress_amendments.py","lineNumber":83,"sourceCode":"        description=\"Maximum number of results to return. When None, defaults to 100 (max 250).\"\n        + \" Set to 0 for no limit (must be used with 'amendment_type').\",\n    )\n    offset: int | None = Field(\n        default=None, description=\"The starting record returned. 0 is the first record.\"\n    )\n    sort_by: Literal[\"asc\", \"desc\"] = Field(\n        default=\"desc\", description=\"Sort by update date. Default is latest first.\"\n    )\n\n    @model_validator(mode=\"after\")\n    @classmethod\n    def validate_query(cls, values):\n        \"\"\"Validate the query parameters.\"\"\"\n        if (\n            values.amendment_type is not None\n            and values.amendment_type not in AmendmentTypes\n        ):\n            raise OpenBBError(\n                ValueError(\n                    f\"Invalid amendment_type: {values.amendment_type}.\"\n                    f\" Must be one of: {', '.join(AmendmentTypes)}.\"\n                )\n            )\n        if values.limit == 0 and values.amendment_type is None:\n            raise OpenBBError(\n                ValueError(\"'limit' cannot be set to 0 without 'amendment_type'.\")\n            )\n        return values\n\n\nclass CongressAmendmentsData(Data):\n    \"\"\"Congress Amendments Data.\"\"\"\n\n    __alias_dict__ = {\n        \"amendment_type\": \"type\",\n        \"amendment_url\": \"url\",","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/congress_gov/openbb_congress_gov/models/congress_amendments.py#L65-L101","documentation":"OpenBBError from a pydantic model_validator on CongressAmendmentsQueryParams: the optional amendment_type must be one of the AmendmentTypes constants (e.g. 'hamdt', 'samdt') when provided. Raised at parameter-validation time, before any HTTP request, with the allowed list embedded in the message.","triggerScenarios":"Calling obb.congress.amendments with amendment_type='house' or 'h'amdt'' instead of 'hamdt'; passing the long form 'House Amendment' from a UI; forwarding an unvalidated user string.","commonSituations":"Not reading the allowed-values list in the message/docs; mixing up chamber names with amendment-type codes; data-entry fields without constrained inputs.","solutions":["Use one of the codes listed in the error message (e.g. 'hamdt' for House amendments, 'samdt' for Senate).","Confirm the exact set via the endpoint's parameter docs or AmendmentTypes in openbb_congress_gov.models.congress_amendments.","Constrain your own inputs to a Literal/dropdown of valid codes."],"exampleFix":"# before\nobb.congress.amendments(amendment_type='house-amendment')\n\n# after\nobb.congress.amendments(amendment_type='hamdt')","handlingStrategy":"type-guard","validationCode":"AMENDMENT_TYPES = {'hamdt', 'samdt'}\nif amendment_type is not None:\n    assert amendment_type in AMENDMENT_TYPES, f'use one of {AMENDMENT_TYPES}'","typeGuard":"from typing import Literal\nAmendmentType = Literal['hamdt', 'samdt']\n\ndef is_amendment_type(v: str) -> bool:\n    return v in ('hamdt', 'samdt')","tryCatchPattern":null,"preventionTips":["Use the provider's type codes, not chamber names or long titles.","Drive amendment_type from a dropdown limited to valid codes.","Check the error message itself: it lists every allowed value."],"tags":["congress-gov","validation","query-params","amendments","openbb"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}