medium severityHaystack Pipeline serialization (dumps(), dump())

AttributeError: 'str' object has no attribute '__name__' when calling pipeline.dumps() or similar serialization on pipeline with certain components (e.g., FaithfulnessEvaluator). YAML dump fails deep in representer on improper object types.

Root cause

Haystack pipeline serialization (via YAML marshal of to_dict()) fails when components don't meet default serialization requirements: no 1:1 init param to self.attribute mapping, or contain non-YAML/JSON serializable objects (sets, callables, unhandled types) without custom to_dict()/from_dict(). YAML representer chokes on improper objects (e.g., treating str as function, AttributeError '__name__'). Specific to components like LLMEvaluator where inputs types aren't serialized properly.

HaystackpipelineserializationYAMLAttributeErrorto_dictcomponentevaluator

Citations