arijeetmukherjee3108-droid commented on code in PR #41625:
URL: https://github.com/apache/beam/pull/41625#discussion_r4686206528


##########
sdks/python/apache_beam/ml/rag/chunking/langchain.py:
##########
@@ -115,4 +120,8 @@ def process(self, element):
     text_chunks = self.text_splitter.split_text(element[self.document_field])
     metadata = {field: element[field] for field in self.metadata_fields}
     for i, text_chunk in enumerate(text_chunks):
-      yield Chunk(content=Content(text=text_chunk), index=i, metadata=metadata)
+      yield Chunk(
+          content=Content(text=text_chunk),
+          index=i,
+          metadata=copy.deepcopy(metadata))
+      

Review Comment:
   It is fixed now. Removed the trailing whitespace-only lines and added proper 
final newlines to both langchain.py and langchain_test.py.



-- 
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]

Reply via email to