{"record":{"id":"f8be113e5a08e500","repo":"apache/beam","slug":"collection-name-must-be-provided","errorCode":null,"errorMessage":"Collection name must be provided","messagePattern":"Collection name must be provided","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/ml/rag/enrichment/milvus_search.py","lineNumber":243,"sourceCode":"    partition_names: List of partition names to restrict the search to. If\n      empty, all partitions will be searched.\n    output_fields: List of field names to include in search results. If empty,\n      only primary fields including distances will be returned.\n    timeout: Search operation timeout in seconds. If not specified, the client's\n      default timeout is used.\n    round_decimal: Number of decimal places for distance/similarity scores.\n      Defaults to -1 means no rounding.\n  \"\"\"\n  collection_name: str\n  search_strategy: SearchStrategyType\n  partition_names: list[str] = field(default_factory=list)\n  output_fields: list[str] = field(default_factory=list)\n  timeout: Optional[float] = None\n  round_decimal: int = -1\n\n  def __post_init__(self):\n    if not self.collection_name:\n      raise ValueError(\"Collection name must be provided\")\n\n    if not self.search_strategy:\n      raise ValueError(\"Search strategy must be provided\")\n\n\n@dataclass\nclass MilvusCollectionLoadParameters:\n  \"\"\"Parameters that control how Milvus loads a collection into memory.\n\n  This class provides fine-grained control over collection loading, which is\n  particularly important in resource-constrained environments. Proper\n  configuration can significantly reduce memory usage and improve query\n  performance by loading only necessary data.\n\n  Args:\n    refresh: If True, forces a reload of the collection even if already loaded.\n      Ensures the most up-to-date data is in memory.\n    resource_groups: List of resource groups to load the collection into. Can be","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/ml/rag/enrichment/milvus_search.py#L225-L261","documentation":"MilvusVectorSearchParameters wraps everything needed to execute a search against a specific Milvus collection. Since a search cannot proceed without a target collection, __post_init__ raises ValueError when collection_name is empty (its default).","triggerScenarios":"Constructing MilvusVectorSearchParameters(search_strategy=...) without collection_name, or collection_name='' — e.g. leaving it to be filled 'later' or a config key typo (collection vs collection_name).","commonSituations":"Environment-driven configs where the collection name env var is unset; copying parameter blocks between projects and forgetting to change the collection; typos in config keys.","solutions":["Pass collection_name='<your collection>' when constructing MilvusVectorSearchParameters.","Verify the config/env value feeding collection_name is non-empty before building the object.","List existing collections (utility.list_collections()) to confirm the name exists in your Milvus instance."],"exampleFix":"// before\nparams = MilvusVectorSearchParameters(search_strategy=strategy)\n// after\nparams = MilvusVectorSearchParameters(collection_name='my_docs', search_strategy=strategy)","handlingStrategy":"validation","validationCode":"collection = os.environ.get('MILVUS_COLLECTION')\nif not collection:\n    raise ValueError('MILVUS_COLLECTION env var must be set')","typeGuard":null,"tryCatchPattern":"try:\n    params = MilvusVectorSearchParameters(**cfg)\nexcept ValueError as e:\n    if 'Collection name' in str(e):\n        logging.error('collection_name missing from Milvus config: %s', e)\n    raise","preventionTips":["Fail fast at startup if the collection-name env/config var is empty.","Verify the collection exists with utility.list_collections() before running.","Watch for config key typos (collection vs collection_name)."],"tags":["python","milvus","rag","config"],"backgroundTag":"missing-required-config-field","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}