Skip to content
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

docs: adding field descriptions to predefined text document #1770

Merged

Conversation

punndcoder28
Copy link
Contributor

  • Adds field descriptions and example usage of each field for the predefined Text

@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.13% 🎉

Comparison is base (715252a) 83.73% compared to head (2ee9c01) 83.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1770      +/-   ##
==========================================
+ Coverage   83.73%   83.87%   +0.13%     
==========================================
  Files         136      136              
  Lines        9040     9041       +1     
==========================================
+ Hits         7570     7583      +13     
+ Misses       1470     1458      -12     
Flag Coverage Δ
docarray 83.87% <100.00%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
docarray/documents/text.py 96.66% <100.00%> (+0.11%) ⬆️

... and 16 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@punndcoder28
Copy link
Contributor Author

punndcoder28 commented Sep 1, 2023

@JoanFM I've added an initial implementation of the change to add a field description for attribute of Text document. Would love to hear your thoughts and more changes that are needed. Can the example attribute from Field have a multi-line example? Since for bytes I want to provide one of video or audio bytes which needs a multiple line example

@JoanFM
Copy link
Member

JoanFM commented Sep 1, 2023

Hello @punndcoder28 ,

Thanks for the contribution. However, we would need you to sign off the commit so that we can incorporate your improvements.

@punndcoder28 punndcoder28 force-pushed the docs_adding_field_description_text_document branch from fe2cae2 to 41ee465 Compare September 1, 2023 18:04
@punndcoder28
Copy link
Contributor Author

Sorry for that. The commits should be signed off now

docarray/documents/text.py Outdated Show resolved Hide resolved
docarray/documents/text.py Outdated Show resolved Hide resolved
@punndcoder28 punndcoder28 force-pushed the docs_adding_field_description_text_document branch 2 times, most recently from 4146e00 to 213448a Compare September 5, 2023 17:09
docarray/documents/text.py Outdated Show resolved Hide resolved
docarray/documents/text.py Outdated Show resolved Hide resolved
docarray/documents/text.py Outdated Show resolved Hide resolved
@punndcoder28
Copy link
Contributor Author

@JoanFM What is the correct github flow? Should I rebase and keep my commits for a PR to a single commit? Or each change should be a different commit?

@punndcoder28 punndcoder28 force-pushed the docs_adding_field_description_text_document branch 2 times, most recently from 856b6ea to 81b7fdc Compare September 6, 2023 18:01
@punndcoder28 punndcoder28 force-pushed the docs_adding_field_description_text_document branch from 81b7fdc to 0b4f618 Compare September 6, 2023 18:19
@JoanFM
Copy link
Member

JoanFM commented Sep 6, 2023

@JoanFM What is the correct github flow? Should I rebase and keep my commits for a PR to a single commit? Or each change should be a different commit?

As you want, eventually all the commits will be squashed into a single one, so your choice

Copy link
Member

@JohannesMessner JohannesMessner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! :)

docarray/documents/text.py Outdated Show resolved Hide resolved
@punndcoder28 punndcoder28 force-pushed the docs_adding_field_description_text_document branch from 0b4f618 to f7362a6 Compare September 8, 2023 16:58
Copy link
Member

@JoanFM JoanFM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor change

)
embedding: Optional[AnyEmbedding] = Field(
description='Store an embedding: a vector representation of the text',
example='''[[1, 1, 1], [1, 0, 1], [0, 0, 1]]''',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better have a single vector in the example

docarray/documents/text.py Outdated Show resolved Hide resolved
@JoanFM
Copy link
Member

JoanFM commented Sep 14, 2023

To resolve the conflicts, make sure to add None as the default value for the Optional fields.

@JoanFM
Copy link
Member

JoanFM commented Sep 14, 2023

Also, the embedding example can be a list and should not be actually a text

Signed-off-by: punndcoder28 <puneethk.2899@gmail.com>
Signed-off-by: punndcoder28 <puneethk.2899@gmail.com>
@punndcoder28 punndcoder28 force-pushed the docs_adding_field_description_text_document branch from f7362a6 to 6e80337 Compare September 14, 2023 17:12
docarray/documents/text.py Outdated Show resolved Hide resolved
Signed-off-by: punndcoder28 <puneethk.2899@gmail.com>
@punndcoder28 punndcoder28 force-pushed the docs_adding_field_description_text_document branch from 6e80337 to 2ee9c01 Compare September 14, 2023 17:16
@JoanFM JoanFM merged commit 68cc142 into docarray:main Sep 14, 2023
37 of 40 checks passed
@JoanFM JoanFM mentioned this pull request Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants