Skip to content
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

fix: list_indices never updated after first call #2936

Merged
merged 4 commits into from
Sep 26, 2024

Conversation

BubbleCal
Copy link
Contributor

@BubbleCal BubbleCal commented Sep 26, 2024

lance in rust would cache the index metadata so no need to cache it in python.

  • also added an option to control which indices to optimize
  • also added tests for optimize_indices

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
@github-actions github-actions bot added bug Something isn't working python labels Sep 26, 2024
@BubbleCal BubbleCal marked this pull request as ready for review September 26, 2024 11:45
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
Copy link
Contributor

@westonpace westonpace left a comment

Choose a reason for hiding this comment

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

Looks fine but could maybe use one more test case

num_indices_to_merge: int, default 1
The number of indices to merge.
If set to 0, new delta index will be created.
indexe_names: List[str], default None
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
indexe_names: List[str], default None
index_names: List[str], default None

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment on lines +1031 to +1037
dataset
.optimize_indices(&OptimizeOptions {
num_indices_to_merge: 0, // Just create index for delta
index_names: Some(vec![]), // Optimize nothing
})
.await
.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to add a test case where index_names is set but non-empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, added tests to cover it

@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 96.25000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.77%. Comparing base (51126ab) to head (595c863).

Files with missing lines Patch % Lines
rust/lance/src/index.rs 96.20% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2936      +/-   ##
==========================================
+ Coverage   77.76%   77.77%   +0.01%     
==========================================
  Files         231      231              
  Lines       70487    70562      +75     
  Branches    70487    70562      +75     
==========================================
+ Hits        54817    54883      +66     
+ Misses      12771    12769       -2     
- Partials     2899     2910      +11     
Flag Coverage Δ
unittests 77.77% <96.25%> (+0.01%) ⬆️

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: BubbleCal <bubble-cal@outlook.com>
@BubbleCal BubbleCal merged commit ed86ff6 into lancedb:main Sep 26, 2024
22 checks passed
ankitvij-db pushed a commit to ankitvij-db/lance that referenced this pull request Sep 26, 2024
lance in rust would cache the index metadata so no need to cache it in
python.

- also added an option to control which indices to optimize
- also added tests for optimize_indices

---------

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants