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

add arrays contains function #860

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

shcheklein
Copy link
Member

@shcheklein shcheklein commented Jan 27, 2025

Adds:

chain.filter(array.contains("emd", 1.0)).show()

to be used in queries like:

embeddings = [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]]
chain = DataChain.from_values(emd=embeddings).save("embeddings")
chain.filter(array.contains("emd", 1.0)).show()

TODO:

  • Add tests
  • Check CH
  • Update docs and examples

Copy link

Deploying datachain-documentation with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3f689cd
Status: ✅  Deploy successful!
Preview URL: https://1816b108.datachain-documentation.pages.dev
Branch Preview URL: https://add-array-contains-function.datachain-documentation.pages.dev

View logs

@shcheklein shcheklein marked this pull request as draft January 27, 2025 03:13
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 10 lines in your changes missing coverage. Please review.

Project coverage is 87.55%. Comparing base (13e5c13) to head (3f689cd).

Files with missing lines Patch % Lines
src/datachain/func/array.py 20.00% 8 Missing ⚠️
src/datachain/sql/sqlite/base.py 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #860      +/-   ##
==========================================
+ Coverage   87.53%   87.55%   +0.02%     
==========================================
  Files         128      128              
  Lines       11369    11390      +21     
  Branches     1538     1539       +1     
==========================================
+ Hits         9952     9973      +21     
- Misses       1029     1030       +1     
+ Partials      388      387       -1     
Flag Coverage Δ
datachain 87.48% <60.00%> (+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.

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.

1 participant