You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I receive a PipelineConnect error if I try to deserialize a pipeline containing a
component with output type list[Document]. If I change to List[Document], the error
goes away.
Error message
Error that was thrown (if available)
haystack.core.errors.PipelineConnectError: Cannot connect 'mux.value' with 'paris_router.documents': their declared input and output types do not match.
'mux':
- value: list
'paris_router':
- documents: List[Document] (available)
Expected behavior
Expected no error. Per PEP-585 (implemented originally in Python 3.9)
Additional context
It's possible one could view this as a documentation problem -- in that it is not documented
that list[X] and List[X] are not treated the same by the deserialization mechanism, but it
seems a bit of a "gotcha" to me.
To Reproduce
Example:
Run the following code:
from haystack import Document, Pipeline
from haystack.components.others import Multiplexer
from haystack.components.routers import MetadataRouter
p = Pipeline()
p.add_component("mux", Multiplexer(list[Document]))
p.add_component("paris_router", MetadataRouter(
rules={"city": {"field": "meta.city", "operator": "==", "value": "Paris"}}))
p.connect("mux.value", "paris_router.documents")
s = p.dumps()
print(s)
p2 = Pipeline.loads(s)
To work around, just replace list[Document] with List[Document] (and import List from typing module obvi)
Hi there, thanks for writing such a detailed issue, we are looking into it! I am the product manager of the library and I like to reach out to users to get feedback and see how we could help. Let me know if you would be available some time this week for a 15 min chat (calendly).
Describe the bug
I receive a PipelineConnect error if I try to deserialize a pipeline containing a
component with output type list[Document]. If I change to List[Document], the error
goes away.
Error message
Error that was thrown (if available)
Expected behavior
Expected no error. Per PEP-585 (implemented originally in Python 3.9)
Additional context
It's possible one could view this as a documentation problem -- in that it is not documented
that list[X] and List[X] are not treated the same by the deserialization mechanism, but it
seems a bit of a "gotcha" to me.
To Reproduce
Example:
Run the following code:
To work around, just replace list[Document] with List[Document] (and import List from typing module obvi)
FAQ Check
System:
The text was updated successfully, but these errors were encountered: