Skip to content

docs: explain how to set document config #1773

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

Merged
merged 2 commits into from
Sep 5, 2023
Merged

Conversation

JohannesMessner
Copy link
Member

@JohannesMessner JohannesMessner commented Sep 5, 2023

there is a small things that users need to be aware of when setting configs, so i am explaining that here.

TODO: small test done

@JohannesMessner JohannesMessner marked this pull request as ready for review September 5, 2023 09:08
@JohannesMessner JohannesMessner marked this pull request as draft September 5, 2023 09:09
@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (3dc525f) 85.00% compared to head (d587a6a) 85.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1773   +/-   ##
=======================================
  Coverage   85.00%   85.00%           
=======================================
  Files         134      134           
  Lines        8845     8845           
=======================================
  Hits         7519     7519           
  Misses       1326     1326           
Flag Coverage Δ
docarray 85.00% <ø> (ø)

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

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

Signed-off-by: Johannes Messner <[email protected]>
@JohannesMessner JohannesMessner marked this pull request as ready for review September 5, 2023 09:20
@JohannesMessner
Copy link
Member Author

@samsja what will be the effect of pydantic v2 on this?

@samsja
Copy link
Member

samsja commented Sep 5, 2023

@samsja what will be the effect of pydantic v2 on this?

this way will still be compatible with pydantic v2 but pydantic will show a warning saying it is deprecated. I suggest we update the docs after the merge



class MyDoc(BaseDoc):
class Config(BaseDoc.Config):

Choose a reason for hiding this comment

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

Minor comment. In pydantic v1, we only had to pass a class Config in the model. It didn't need to be inherited from another config class.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, in pydantic that is not needed. But we set some pydantic configs in BaseDoc, so to preserve them, inheritance is needed. We could probably find some magic way around this, but until then this is the safest option imo.

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

📝 Docs are deployed on https://ft-docs-document-config--jina-docs.netlify.app 🎉

@JohannesMessner JohannesMessner merged commit 189ff63 into main Sep 5, 2023
@JohannesMessner JohannesMessner deleted the docs-document-config branch September 5, 2023 11:21
@JoanFM JoanFM mentioned this pull request Sep 7, 2023
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