From 5e06a0d00128c5217e89990b84a1d17b7633bd7f Mon Sep 17 00:00:00 2001 From: David Talson <37641675+dtee1@users.noreply.github.com> Date: Wed, 13 Sep 2023 16:36:23 -0400 Subject: [PATCH] Fix/dont print the entire text when data type is text (#605) --- embedchain/embedchain.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py index dbc5d7c9..03fcdeeb 100644 --- a/embedchain/embedchain.py +++ b/embedchain/embedchain.py @@ -284,7 +284,10 @@ class EmbedChain(JSONSerializable): data_dict = {id: value for id, value in data_dict.items() if id not in existing_ids} if not data_dict: - print(f"All data from {src} already exists in the database.") + src_copy = src + if len(src_copy) > 50: + src_copy = src[:50] + "..." + print(f"All data from {src_copy} already exists in the database.") # Make sure to return a matching return type return [], [], [], 0 @@ -418,7 +421,10 @@ class EmbedChain(JSONSerializable): data_dict = {id: value for id, value in data_dict.items() if id not in existing_ids} if not data_dict: - print(f"All data from {src} already exists in the database.") + src_copy = src + if len(src_copy) > 50: + src_copy = src[:50] + "..." + print(f"All data from {src_copy} already exists in the database.") # Make sure to return a matching return type return [], [], [], 0