Skip to content

[Old] docs(array): add section on persistence mutation and context manager#610

Closed
Jackmin801 wants to merge 6 commits intodocarray:mainfrom
Jackmin801:docs-array-528
Closed

[Old] docs(array): add section on persistence mutation and context manager#610
Jackmin801 wants to merge 6 commits intodocarray:mainfrom
Jackmin801:docs-array-528

Conversation

@Jackmin801
Copy link
Copy Markdown
Contributor

Goals:

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 11, 2022

Codecov Report

Merging #610 (5619e2c) into main (944b91b) will increase coverage by 0.01%.
The diff coverage is n/a.

@@            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     
Flag Coverage Δ
docarray 84.92% <ø> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
docarray/array/storage/weaviate/find.py 84.81% <0.00%> (+1.26%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

Have we checked if the Examples and code snippets do follow these considerations?

@JoanFM JoanFM requested a review from NicholasDunham October 11, 2022 19:25
Copy link
Copy Markdown
Contributor

@NicholasDunham NicholasDunham left a comment

Choose a reason for hiding this comment

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

Some minor grammatical changes

@Jackmin801
Copy link
Copy Markdown
Contributor Author

Jackmin801 commented Oct 11, 2022

@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.

@Jackmin801
Copy link
Copy Markdown
Contributor Author

Jackmin801 commented Oct 11, 2022

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.

Co-authored-by: Nicholas Dunham <[email protected]>
Signed-off-by: Jackmin801 <[email protected]>
@Jackmin801
Copy link
Copy Markdown
Contributor Author

Thanks @NicholasDunham 👍🏻

@JohannesMessner
Copy link
Copy Markdown
Member

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.

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?

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.

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

@Jackmin801 Jackmin801 changed the title docs(array): add section on persistence mutation and context manager [Old] docs(array): add section on persistence mutation and context manager Oct 13, 2022
@Jackmin801
Copy link
Copy Markdown
Contributor Author

Merging the mirror of this branch in Jina repo is better. Closing this PR

@Jackmin801 Jackmin801 closed this Oct 13, 2022
@Jackmin801 Jackmin801 deleted the docs-array-528 branch October 13, 2022 08:30
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.

5 participants