{"record":{"id":"18e5ecc035c16e39","repo":"cocoindex-io/cocoindex","slug":"column-name-r-cannot-combine-zvecftstype-with-zv","errorCode":null,"errorMessage":"Column {name!r} cannot combine ZvecFtsType with ZvecType.","messagePattern":"Column (.+?) cannot combine ZvecFtsType with ZvecType\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/cocoindex/connectors/zvec/_target.py","lineNumber":401,"sourceCode":"    if vector_def is not None and vector_def.sparse:\n        return _Column(\n            name=name,\n            kind=\"sparse\",\n            data_type=_zvec.DataType.SPARSE_VECTOR_FP32,\n            nullable=type_info.nullable,\n            metric=vector_def.metric,\n        )\n\n    if type_info.base_type is np.ndarray:\n        raise ValueError(\n            f\"Vector column {name!r} requires a VectorSchema (provide it via an \"\n            \"Annotated NDArray or column_overrides).\"\n        )\n\n    # Full-text field: str marked with ZvecFtsType.\n    if fts_type is not None:\n        if zvec_type is not None:\n            raise ValueError(\n                f\"Column {name!r} cannot combine ZvecFtsType with ZvecType.\"\n            )\n        if type_info.base_type is not str:\n            raise ValueError(\n                f\"ZvecFtsType on column {name!r} requires a str field, got \"\n                f\"{type_info.base_type!r}.\"\n            )\n        return _Column(\n            name=name,\n            kind=\"fts\",\n            data_type=_zvec.DataType.STRING,\n            nullable=type_info.nullable,\n            tokenizer_name=fts_type.tokenizer_name,\n            filters=fts_type.filters,\n            extra_params=fts_type.extra_params,\n        )\n\n    # Scalar field.","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/cocoindex-io/cocoindex/blob/e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b/python/cocoindex/connectors/zvec/_target.py#L383-L419","documentation":"Annotation-conflict guard in _resolve_column. ZvecFtsType marks a column as a full-text search field and ZvecType as a typed scalar column; a single zvec column cannot be both, so the two annotations on one field would produce contradictory schema definitions. Raised during collection schema building (from_class) when both annotations are present on the same column. Keep only one of the two annotations per column.","triggerScenarios":"Annotating a str field with both ZvecFtsType and ZvecType (e.g. Annotated[str, ZvecFtsType(), ZvecType(...)]) in a from_class row type.","commonSituations":"Copy-pasting annotations between fields; incrementally converting a field to FTS without removing the old ZvecType annotation.","solutions":["Remove the ZvecType annotation and keep only ZvecFtsType for FTS fields","Or remove ZvecFtsType if the column should be a regular typed column","Split into two columns if both behaviors are needed"],"exampleFix":"// before\ntext: Annotated[str, ZvecFtsType(), ZvecType()]\n// after\ntext: Annotated[str, ZvecFtsType()]","handlingStrategy":"validation","validationCode":"annots = [a for a in get_args(hint)[1:]]\nassert not (any(isinstance(a, ZvecFtsType) for a in annots) and any(isinstance(a, ZvecType) for a in annots)), \"remove ZvecType from FTS fields\"","typeGuard":null,"tryCatchPattern":"try:\n    schema = ZvecCollection.from_class(Row)\nexcept ValueError as e:\n    if \"cannot combine ZvecFtsType with ZvecType\" in str(e):\n        # drop one of the two annotations on that column\n        ...\n    else:\n        raise","preventionTips":["Use ZvecFtsType alone on searchable text fields","Don't mix type annotations when converting fields between kinds","Review Annotated stacks when refactoring row classes"],"tags":["python","validation","annotations","zvec"],"backgroundTag":"conflicting-config-options","analyzedSha":"e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b","analyzedAt":"2026-09-08T15:59:19.997Z","contentChangedAt":"2026-09-08T15:59:19.997Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}