Skip to content

feat: init text directly#1067

Merged
samsja merged 1 commit intofeat-rewrite-v2from
feat-init-Text-directly
Feb 1, 2023
Merged

feat: init text directly#1067
samsja merged 1 commit intofeat-rewrite-v2from
feat-init-Text-directly

Conversation

@JoanFM
Copy link
Copy Markdown
Member

@JoanFM JoanFM commented Jan 31, 2023

Goals:
Solves #1056

Allows to have a less-verbose Text initalization:

from docarray.documents import Text
Text('hello world')

works

@JoanFM JoanFM linked an issue Jan 31, 2023 that may be closed by this pull request
@JoanFM JoanFM requested a review from samsja January 31, 2023 16:42
@JoanFM JoanFM force-pushed the feat-init-Text-directly branch from 8f4302d to 5c3938f Compare January 31, 2023 16:42
Copy link
Copy Markdown
Member

@samsja samsja left a comment

Choose a reason for hiding this comment

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

can we add it to the docstring ?

Signed-off-by: Joan Fontanals Martinez <[email protected]>
@JoanFM JoanFM force-pushed the feat-init-Text-directly branch from 5c3938f to 365e718 Compare January 31, 2023 17:09
@JoanFM
Copy link
Copy Markdown
Member Author

JoanFM commented Jan 31, 2023

can we add it to the docstring ?

Check now

@github-actions
Copy link
Copy Markdown

📝 Docs are deployed on https://ft-feat-init-Text-directly--jina-docs.netlify.app 🎉

@JoanFM JoanFM requested a review from samsja January 31, 2023 17:23
@JoanFM
Copy link
Copy Markdown
Member Author

JoanFM commented Jan 31, 2023

partially fix : #1056

Copy link
Copy Markdown
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.

I wonder if we can automate this for all of our pre-built docs. They could define something like __docarray_main_field__ that just points to the correct field and then in the BaseDocument it does exactly what you are doing here

@samsja samsja merged commit 577d072 into feat-rewrite-v2 Feb 1, 2023
@samsja samsja deleted the feat-init-Text-directly branch February 1, 2023 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants