deepset-ai / canals

A component orchestration engine
https://deepset-ai.github.io/canals/
Apache License 2.0
27 stars 2 forks source link

Sockets named "text/plain" or containing a "/" fail during `pipeline.to_dict` #130

Closed julian-risch closed 11 months ago

julian-risch commented 11 months ago

Using a component in Haystack that has an output connection named text/plain I noticed that the split by \ in canals fails for connections with / in the name when calling to_dict.

The line that fails is https://github.com/deepset-ai/canals/blob/2971b4de2aeea28704ad03931e16dd6f642ada8b/canals/pipeline/pipeline.py#L93 with a ValueError: too many values to unpack (expected 2)

To reproduce, from this PR https://github.com/deepset-ai/haystack/pull/6037/:

from haystack.preview import Pipeline
from haystack.preview.components.routers import FileTypeRouter
from haystack.preview.components.file_converters import TextFileToDocument
p = Pipeline()
p.add_component(instance=FileTypeRouter(mime_types=["text/plain"]), name="file_type_router")
p.add_component(instance=TextFileToDocument(), name="text_file_converter")
p.connect("file_type_router.text/plain", "text_file_converter.paths")