[Old] docs(array): add section on persistence mutation and context manager#610
[Old] docs(array): add section on persistence mutation and context manager#610Jackmin801 wants to merge 6 commits intodocarray:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #610 +/- ##
==========================================
+ Coverage 84.91% 84.92% +0.01%
==========================================
Files 133 133
Lines 6715 6715
==========================================
+ Hits 5702 5703 +1
+ Misses 1013 1012 -1
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. |
JoanFM
left a comment
There was a problem hiding this comment.
Have we checked if the Examples and code snippets do follow these considerations?
NicholasDunham
left a comment
There was a problem hiding this comment.
Some minor grammatical changes
|
@JoanFM The examples given are correct to the latest release of docarray. However, the considerations are not necessary for all backends. Some persist even when not using the context manager. Though the correctness of these backends will be unaffected by following the suggestions. If these are the intended considerations for using DocArrays backed by vector databases I think it's best to document it that way rather than go through all the nuance and minutiae of which implementations of which methods on which backend may or may not require context manager. Which we don't define and can't guarantee will be consistent in future releases. |
|
Basically. By enforcing these considerations, we are telling users that if they perform any mutations, using context manager or scopes is guaranteed to have the expected behaviour of persistence. Outside of this, we cannot guarantee anything. So users should probably not do any mutations outside of context manager or scope. |
af0e559 to
72af96d
Compare
Co-authored-by: Nicholas Dunham <[email protected]> Signed-off-by: Jackmin801 <[email protected]>
|
Thanks @NicholasDunham 👍🏻 |
I agree with this philosophy for the reason than @Jackmin801, and also for a slightly different one: If we tell users to always use a context manager they will have a much easier time switching between storage backends. Additionally I think we should come up with a soft guideline for backend developers, do we generally prefer eager or lazy persistence? |
JohannesMessner
left a comment
There was a problem hiding this comment.
Nice explanation, really clear!
As you will find out over time I am quite picky about documentation, so I left a few things that I would change ;)
Also please change we to you everywhere, we want to be consistent about this. For reference: https://github.com/jina-ai/jina/blob/master/CONTRIBUTING.md#-contributing-documentation
Co-authored-by: Johannes Messner <[email protected]> Signed-off-by: Jackmin801 <[email protected]>
|
Merging the mirror of this branch in Jina repo is better. Closing this PR |
Goals:
withstatement) when da is backed by vector database #528