Repository: mem0ai/mem0
Pull request: Fix/dont print the entire text when data type is text
## Description

Make data (src) in print statement which is longer than 50 characters to be shortened with ellipsis

Fixes #602 

##Bug

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)


## How Has This Been Tested?
Tested the function

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Please delete options that are not relevant.

- [ ] Unit Test

## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] I have checked my code and corrected any misspellings

## Maintainer Checklist

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] Made sure Checks passed


Problem statement:
dont print the entire text when data type is text
### 🐛 Describe the bug

When we are adding a data type "text", the entire text gets printed due to the below statement. 

we can either skip printing text altogether or print part of it.

print(f"All data from {src} already exists in the database.")

Hints from issue discussion:
Could this be assigned to me?
Hey @dtee1 welcome to embedchain.
Yeah sure. Just assigned.

Commit message: Minor fix

Patch to review:
diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py
index d6364b5b49..188429f715 100644
--- a/embedchain/embedchain.py
+++ b/embedchain/embedchain.py
@@ -283,7 +283,10 @@ def load_and_embed(
             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.")
+                srcCopy = src
+                if len(srcCopy) > 50:
+                    srcCopy = src[:50] + "..."
+                print(f"All data from {srcCopy} already exists in the database.")
                 # Make sure to return a matching return type
                 return [], [], [], 0
 
@@ -380,7 +383,10 @@ def load_and_embed_v2(
             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.")
+                srcCopy = src
+                if len(srcCopy) > 50:
+                    srcCopy = src[:50] + "..."
+                print(f"All data from {srcCopy} already exists in the database.")
                 # Make sure to return a matching return type
                 return [], [], [], 0
 


Code review comments:
diff_hunk: @@ -380,7 +383,10 @@ def load_and_embed_v2(
             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.")
+                srcCopy = src
path: embedchain/embedchain.py
text: @user1:
This logic looks good.

Nit pick: can you follow snake case convention for variable naming?

@author:
Done