{"record":{"id":"2e6e887d1fe32514","repo":"run-llama/llama_index","slug":"the-enum-value-self-is-not-compatible-with-compo-2e6e88","errorCode":null,"errorMessage":"The enum value {self} is not compatible with component of type {type(component)}","messagePattern":"The enum value (.+?) is not compatible with component of type (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/ingestion/transformations.py","lineNumber":109,"sourceCode":"\n\nclass ConfigurableComponent(Enum):\n    @classmethod\n    def from_component(cls, component: BaseComponent) -> \"ConfigurableComponent\":\n        component_class = type(component)\n        for component_type in cls:\n            if component_type.value.component_type == component_class:\n                return component_type\n        raise ValueError(\n            f\"Component {component} is not a supported transformation component.\"\n        )\n\n    def build_configured_transformation(\n        self, component: BaseComponent\n    ) -> \"ConfiguredTransformation\":\n        component_type = self.value.component_type\n        if not isinstance(component, component_type):\n            raise ValueError(\n                f\"The enum value {self} is not compatible with component of \"\n                f\"type {type(component)}\"\n            )\n        return ConfiguredTransformation[component_type](  # type: ignore\n            component=component, name=self.value.name\n        )\n\n\ndef build_configurable_transformation_enum() -> ConfigurableComponent:\n    \"\"\"\n    Build an enum of configurable transformations.\n    But conditional on if the corresponding component is available.\n    \"\"\"\n    enum_members = []\n\n    # Node parsers\n    enum_members.append(\n        (","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/ingestion/transformations.py#L91-L127","documentation":"Raised by build_configured_transformation() when the enum member's registered component_type does not match the transformation instance passed. The isinstance check keeps the ConfiguredTransformation generic type consistent with the wrapped component; a mismatched member/instance pair is rejected.","triggerScenarios":"Calling a fixed enum member's build_configured_transformation() with a different transformation class, e.g. a sentence-splitter member given a custom node parser; stale members persisted in saved workflow definitions after swapping transformations.","commonSituations":"Serialized workflow configurations that pin enum members; refactors that change the transformation but not the member lookup.","solutions":["Resolve the member dynamically with ConfigurableComponent.from_component(component).","Add an isinstance guard against member.value.component_type before building.","Regenerate saved workflow configs whenever transformations change."],"exampleFix":"# before\nt = ConfigurableComponent.SENTENCE_SPLITTER.build_configured_transformation(my_custom_splitter)  # raises\n\n# after\nmember = ConfigurableComponent.from_component(my_custom_splitter)\nt = member.build_configured_transformation(my_custom_splitter)","handlingStrategy":"validation","validationCode":"assert isinstance(component, member.value.component_type), (\n    f'{member} expects {member.value.component_type}'\n)","typeGuard":null,"tryCatchPattern":"try:\n    t = member.build_configured_transformation(component)\nexcept ValueError:\n    member = ConfigurableComponent.from_component(component)\n    t = member.build_configured_transformation(component)","preventionTips":["Resolve members dynamically via from_component()","Invalidate cached workflow transformation configs on refactors"],"tags":["ingestion","transformations","workflow","type-mismatch"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}