New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: replace newline with whitespace to fix display in plot embeddings #963
Conversation
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Codecov ReportBase: 85.20% // Head: 85.20% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #963 +/- ##
=======================================
Coverage 85.20% 85.20%
=======================================
Files 155 155
Lines 8050 8051 +1
=======================================
+ Hits 6859 6860 +1
Misses 1191 1191
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, love to see PR descriptions like this one! 👍
docarray/array/mixins/io/csv.py
Outdated
@@ -86,6 +86,8 @@ def save_csv( | |||
if flatten_tags: | |||
t = pd.pop('tags') | |||
pd.update({f'tag__{k}': v for k, v in t.items()}) | |||
|
|||
pd = {k: str(v).replace('\n', ' ') for k, v in pd.items()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets rename this to something else than pd
since this is usually use for pandas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I don't understand is why the parser don't just do a return to the line by itself ? Is it because it does not handle it ?
have we checked if this is a documented feature/behavior of the dependency we use to plot embeddings? if not, we could in parallel open an issue to them to see if we can remove the hack in the future |
Ok, I will check |
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte charlotte.gerhaher@jina.ai
If a Documents fields contain '\n' this messes up the display in
.plot_embeddings()
.Therefore we want to replace all '\n' with whitespaces for display.
E.g. for the following Document:
The information of that Document looks like this:
But should look like this:
.plot_embeddings()