{"record":{"id":"4ad3b86aa42defb0","repo":"deepset-ai/haystack","slug":"the-value-of-parameter-missing-meta-must-be-dro","errorCode":null,"errorMessage":"The value of parameter <missing_meta> must be 'drop', 'top', or 'bottom', but is currently set to '{missing_meta}'.\nChange the <missing_meta> value to 'drop', 'top', or 'bottom' when initializing the MetaFieldRanker.","messagePattern":"The value of parameter <missing_meta> must be 'drop', 'top', or 'bottom', but is currently set to '(.+?)'\\.\nChange the <missing_meta> value to 'drop', 'top', or 'bottom' when initializing the MetaFieldRanker\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"haystack/components/rankers/meta_field.py","lineNumber":147,"sourceCode":"            )\n\n        if ranking_mode not in [\"reciprocal_rank_fusion\", \"linear_score\"]:\n            raise ValueError(\n                \"The value of parameter <ranking_mode> must be 'reciprocal_rank_fusion' or 'linear_score', but is \"\n                f\"currently set to '{ranking_mode}'.\\nChange the <ranking_mode> value to 'reciprocal_rank_fusion' or \"\n                \"'linear_score' when initializing the MetaFieldRanker.\"\n            )\n\n        if sort_order not in [\"ascending\", \"descending\"]:\n            raise ValueError(\n                \"The value of parameter <sort_order> must be 'ascending' or 'descending', \"\n                f\"but is currently set to '{sort_order}'.\\n\"\n                \"Change the <sort_order> value to 'ascending' or 'descending' when initializing the \"\n                \"MetaFieldRanker.\"\n            )\n\n        if missing_meta not in [\"drop\", \"top\", \"bottom\"]:\n            raise ValueError(\n                \"The value of parameter <missing_meta> must be 'drop', 'top', or 'bottom', \"\n                f\"but is currently set to '{missing_meta}'.\\n\"\n                \"Change the <missing_meta> value to 'drop', 'top', or 'bottom' when initializing the \"\n                \"MetaFieldRanker.\"\n            )\n\n        if meta_value_type not in [\"float\", \"int\", \"date\", None]:\n            raise ValueError(\n                \"The value of parameter <meta_value_type> must be 'float', 'int', 'date' or None but is \"\n                f\"currently set to '{meta_value_type}'.\\n\"\n                \"Change the <meta_value_type> value to 'float', 'int', 'date' or None when initializing the \"\n                \"MetaFieldRanker.\"\n            )\n\n    @component.output_types(documents=list[Document])\n    def run(\n        self,\n        documents: list[Document],","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/components/rankers/meta_field.py#L129-L165","documentation":"MetaFieldRanker._validate_params rejects any missing_meta value other than 'drop', 'top', or 'bottom'. This parameter controls where documents lacking the ranker's meta field are placed; an unknown value raises ValueError in both __init__ and run.","triggerScenarios":"MetaFieldRanker(missing_meta='skip'), 'first', 'last', 'none', or any misspelled string; the check is a case-sensitive membership test against ['drop', 'top', 'bottom'].","commonSituations":"Using synonyms like 'remove'/'last' in configs; porting settings from another ranker with similar-but-different option names; typos such as 'bottom_' or extra whitespace from YAML parsing.","solutions":["Use exactly 'drop', 'top', or 'bottom' (lowercase).","Map external config values to the supported literals before construction (e.g. 'last'->'bottom', 'remove'->'drop').","Strip whitespace and lowercase config-derived values before passing them in."],"exampleFix":"// before\nranker = MetaFieldRanker(missing_meta=\"skip\")\n// after\nranker = MetaFieldRanker(missing_meta=\"drop\")","handlingStrategy":"validation","validationCode":"VALID_MISSING_META = (\"drop\", \"top\", \"bottom\")\nif missing_meta not in VALID_MISSING_META:\n    raise ValueError(f\"missing_meta must be one of {VALID_MISSING_META}, got {missing_meta!r}\")","typeGuard":"def is_valid_missing_meta(v) -> bool:\n    return v in (\"drop\", \"top\", \"bottom\")","tryCatchPattern":"try:\n    ranker = MetaFieldRanker(missing_meta=mm)\nexcept ValueError as e:\n    logger.warning(\"Invalid missing_meta %s; defaulting to 'drop'\", e)\n    ranker = MetaFieldRanker(missing_meta=\"drop\")","preventionTips":["Use only the exact literals 'drop', 'top', 'bottom'.","Strip and lowercase config-derived values before validation.","Document synonyms ('last'->'bottom', 'remove'->'drop') in a mapping for external configs."],"tags":["python","validation","ranker","enum-value"],"backgroundTag":"invalid-enum-value","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}