Skip to content

feat: redis supports multiple DocumentArrays#540

Merged
JoanFM merged 13 commits intodocarray:mainfrom
AnneYang720:feat-redis-multidas
Sep 22, 2022
Merged

feat: redis supports multiple DocumentArrays#540
JoanFM merged 13 commits intodocarray:mainfrom
AnneYang720:feat-redis-multidas

Conversation

@AnneYang720
Copy link
Copy Markdown
Contributor

@AnneYang720 AnneYang720 commented Sep 15, 2022

Goals:

This PR will add support for storing multiple DocumentArrays in the one Redis server instance according to #507

  • add code for redis multiple DocumentArrays
  • modify related tests
  • update documentation

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 15, 2022

Codecov Report

Merging #540 (37198cb) into main (b2ca490) will decrease coverage by 2.37%.
The diff coverage is 100.00%.

❗ Current head 37198cb differs from pull request most recent head 9de62bd. Consider uploading reports for the commit 9de62bd to get more accurate results

@@            Coverage Diff             @@
##             main     #540      +/-   ##
==========================================
- Coverage   86.41%   84.04%   -2.38%     
==========================================
  Files         142      142              
  Lines        7141     7139       -2     
==========================================
- Hits         6171     6000     -171     
- Misses        970     1139     +169     
Flag Coverage Δ
docarray 84.04% <100.00%> (-2.38%) ⬇️

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

Impacted Files Coverage Δ
docarray/array/storage/redis/backend.py 92.30% <100.00%> (-4.31%) ⬇️
docarray/array/storage/redis/getsetdel.py 95.45% <100.00%> (-1.57%) ⬇️
docarray/array/mixins/io/pushpull.py 32.77% <0.00%> (-59.67%) ⬇️
docarray/array/mixins/io/dataframe.py 40.00% <0.00%> (-46.67%) ⬇️
docarray/array/mixins/io/common.py 28.57% <0.00%> (-38.10%) ⬇️
docarray/array/mixins/io/json.py 67.64% <0.00%> (-23.53%) ⬇️
docarray/array/mixins/content.py 83.58% <0.00%> (-13.44%) ⬇️
docarray/array/storage/annlite/backend.py 82.66% <0.00%> (-13.34%) ⬇️
docarray/array/storage/sqlite/backend.py 84.81% <0.00%> (-8.87%) ⬇️
docarray/document/generators.py 78.63% <0.00%> (-7.70%) ⬇️
... and 12 more

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

host: str = field(default='localhost')
port: int = field(default=6379)
index_name: str = field(default='idx')
flush: bool = field(default=False)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

make sure this is not a breaking change

Copy link
Copy Markdown

@bwanglzu bwanglzu left a comment

Choose a reason for hiding this comment

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

havn't start review, but please take a look of the question


if config.index_name is None:
id = uuid.uuid4().hex
config.index_name = 'index_name__' + id
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

can we create a CONSTENT rather than hard code a string?

id = uuid.uuid4().hex
config.index_name = 'index_name__' + id

self._offset2id_key = config.index_name + '__offset2id'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

can we create some constant values?

Copy link
Copy Markdown

@bwanglzu bwanglzu left a comment

Choose a reason for hiding this comment

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

great work! left some comments in the PR

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.

I agree with @bwanglzu suggestions

Copy link
Copy Markdown

@bwanglzu bwanglzu left a comment

Choose a reason for hiding this comment

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

LGTM!

@bwanglzu
Copy link
Copy Markdown

@JoanFM @alaeddine-13 please review again

@JoanFM
Copy link
Copy Markdown
Member

JoanFM commented Sep 20, 2022

@alaeddine-13 why u think tests are failing?

@bwanglzu
Copy link
Copy Markdown

@JoanFM @alaeddine-13 can you review again?

self._client.delete(*keys)
if cursor == 0:
break
pipe = self._client.pipeline()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this pipeline object not a context manager?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

seems no as they didn't document

@alaeddine-13
Copy link
Copy Markdown
Member

@alaeddine-13 why u think tests are failing?

I'm inspecting push/pull failure but still no idea about failure in prepare environment

Copy link
Copy Markdown
Member

@alaeddine-13 alaeddine-13 left a comment

Choose a reason for hiding this comment

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

LGTM, let's try to pass CI

@JoanFM
Copy link
Copy Markdown
Member

JoanFM commented Sep 21, 2022

Hey @AnneYang720 ,

can u try rebasing your code against master?

I am not sure why the tests fail. But another PR has them passing #548

@alaeddine-13
Copy link
Copy Markdown
Member

Hey @AnneYang720 ,

can u try rebasing your code against master?

I am not sure why the tests fail. But another PR has them passing #548

actually this PR is already up-to-date

@alaeddine-13
Copy link
Copy Markdown
Member

Hey @AnneYang720 ,

can u try rebasing your code against master?

I am not sure why the tests fail. But another PR has them passing #548

Okay now I get why it was not passing. The github secret is not set on external contributor CI.
tests passed on this PR.
I mistakenly force pushed to this branch so waiting for @AnneYang720 to push back her work so we can merge the PR

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