sohailshk opened a new issue, #41233:
URL: https://github.com/apache/beam/issues/41233
### What happened?
On master (1878a5ba3aa), _dict_output_fn (ml/transforms/base.py, MLTransform
embeddings with columns=), _add_embedding_fn (ml/rag/embeddings/base.py) and
_multimodal_dict_output_fn (ml/transforms/embeddings/vertex_ai.py) assign the
embeddings onto the elements they are given (item[col] = ..., item.embedding =
...). Those objects are the elements of the input PCollection, so a consumer
that keeps elements on the same PCollection (e.g. beam.combiners.ToList(), a
combiner, batching) can see the embedded values instead of the originals; which
elements are affected depends on batching and execution order. Reproduced on
the FnApiRunner with MLTransform on one branch and ToList() on the other: the
ToList branch received {'x': 'cba'} for the input {'x': 'abc'} (test embedding
handler that reverses the text), and for the RAG adapter an item that already
carried an Embedding. Expected: input elements are not modified. I plan to fix
it by returning copies.
### Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
### Issue Components
- [x] Component: Python SDK
- [ ] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [ ] Component: IO connector
- [ ] Component: Beam YAML
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Infrastructure
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Prism Runner
- [ ] Component: Hazelcast Jet Runner
- [ ] Component: Google Cloud Dataflow Runner
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]