This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 2897618635 NIFI-12536: This closes #8178. Used proper method for 
converting byte array to String
2897618635 is described below

commit 28976186351fca90178a3c6e4c125568a270cba2
Author: Mark Payne <marka...@hotmail.com>
AuthorDate: Thu Dec 21 10:41:14 2023 -0500

    NIFI-12536: This closes #8178. Used proper method for converting byte array 
to String
    
    Signed-off-by: Joseph Witt <joew...@apache.org>
---
 .../nifi-text-embeddings-module/src/main/python/ParseDocument.py        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/nifi-python-extensions/nifi-text-embeddings-module/src/main/python/ParseDocument.py
 
b/nifi-python-extensions/nifi-text-embeddings-module/src/main/python/ParseDocument.py
index 6b26f6aa49..a6582cc346 100644
--- 
a/nifi-python-extensions/nifi-text-embeddings-module/src/main/python/ParseDocument.py
+++ 
b/nifi-python-extensions/nifi-text-embeddings-module/src/main/python/ParseDocument.py
@@ -177,7 +177,7 @@ class ParseDocument(FlowFileTransform):
 
         input_format = 
context.getProperty(self.INPUT_FORMAT).evaluateAttributeExpressions(flowFile).getValue()
         if input_format == PLAIN_TEXT:
-            return [Document(page_content=str(flowFile.getContentsAsBytes()), 
metadata=metadata)]
+            return 
[Document(page_content=flowFile.getContentsAsBytes().decode('utf-8'), 
metadata=metadata)]
 
         element_strategy = 
context.getProperty(self.ELEMENT_STRATEGY).getValue()
         if element_strategy == SINGLE_DOCUMENT:

Reply via email to