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

Types: Add support for CrateDB's FLOAT_VECTOR data type and KNN_MATCH function #9

Merged
merged 6 commits into from
Jun 13, 2024

Conversation

amotl
Copy link
Member

@amotl amotl commented Dec 21, 2023

About

CrateDB's FLOAT_VECTOR data type, and its accompanying KNN_MATCH function, have been added with CrateDB 5.5.0. This patch adds corresponding SQLAlchemy type and function/predicate support.

Details

Those two implementetations have been predecessors, and both sites will be used to verify this patch, after it has been merged.

Backlog

  • Documentation
  • Software tests

@amotl amotl changed the title [TYPES] Added support for CrateDB's FLOAT_VECTOR data type [TYPES] Add support for CrateDB's FLOAT_VECTOR data type Dec 21, 2023
@amotl amotl force-pushed the amo/type-float-vector branch from a232609 to c8305b1 Compare December 21, 2023 14:22
@amotl amotl changed the title [TYPES] Add support for CrateDB's FLOAT_VECTOR data type [TYPES] Add support for CrateDB's FLOAT_VECTOR data type: FloatVector Dec 21, 2023
@amotl amotl force-pushed the amo/type-float-vector branch 4 times, most recently from 264f370 to b2ef319 Compare December 21, 2023 14:38
Base automatically changed from refactor-types to main December 21, 2023 17:52
@amotl amotl force-pushed the amo/type-float-vector branch 2 times, most recently from 99a0e3a to 56bd4b6 Compare December 21, 2023 19:28
@amotl amotl force-pushed the amo/type-float-vector branch from 56bd4b6 to 1070b37 Compare December 22, 2023 00:51
@amotl amotl force-pushed the amo/type-float-vector branch from 1070b37 to 5ddc8e1 Compare January 15, 2024 21:48
@amotl amotl changed the title [TYPES] Add support for CrateDB's FLOAT_VECTOR data type: FloatVector Types: Add support for CrateDB's FLOAT_VECTOR data type: FloatVector Jan 15, 2024
@amotl amotl force-pushed the amo/type-float-vector branch from 5ddc8e1 to 9c550d8 Compare June 7, 2024 13:12
@codecov-commenter
Copy link

codecov-commenter commented Jun 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.74%. Comparing base (6b64619) to head (9557d1c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #9      +/-   ##
==========================================
+ Coverage   84.65%   85.74%   +1.08%     
==========================================
  Files          14       15       +1     
  Lines         919      989      +70     
==========================================
+ Hits          778      848      +70     
  Misses        141      141              
Flag Coverage Δ
main 85.74% <100.00%> (+1.08%) ⬆️

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.

tests/vector_test.py Fixed Show fixed Hide fixed
tests/vector_test.py Fixed Show fixed Hide fixed
tests/vector_test.py Fixed Show fixed Hide fixed
@amotl amotl force-pushed the amo/type-float-vector branch 3 times, most recently from 38e8eee to fd12f98 Compare June 8, 2024 12:15
src/sqlalchemy_cratedb/type/vector.py Outdated Show resolved Hide resolved
src/sqlalchemy_cratedb/type/vector.py Outdated Show resolved Hide resolved
@amotl amotl requested review from seut, matriv and surister June 8, 2024 12:19
@amotl amotl marked this pull request as ready for review June 8, 2024 12:26
@amotl amotl force-pushed the amo/type-float-vector branch 2 times, most recently from ba973a9 to b2f448f Compare June 8, 2024 21:26
@amotl amotl force-pushed the amo/type-float-vector branch 3 times, most recently from 921aefa to ff7c081 Compare June 9, 2024 19:46
tests/vector_test.py Fixed Show fixed Hide fixed
@amotl amotl force-pushed the amo/type-float-vector branch from ff7c081 to 79538f8 Compare June 9, 2024 20:59
@amotl amotl changed the title Types: Add support for CrateDB's FLOAT_VECTOR data type: FloatVector Types: Add support for CrateDB's FLOAT_VECTOR data type and KNN_MATCH function Jun 9, 2024
@amotl amotl force-pushed the amo/type-float-vector branch 2 times, most recently from ca317f8 to 4a4ceb4 Compare June 9, 2024 21:19
@amotl amotl force-pushed the amo/type-float-vector branch 3 times, most recently from 0f85790 to 20443d2 Compare June 10, 2024 10:33
Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

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

thank you!

@amotl amotl force-pushed the amo/type-float-vector branch from 20443d2 to 9557d1c Compare June 13, 2024 14:16
amotl added 6 commits June 13, 2024 16:18
The `all` extra bundles all optional dependencies, like, in this case,
`numpy`, added to support the `FLOAT_VECTOR` data type.
We don't know which circumstances cause this problem. SQLAlchemy 1.3 is
EOL anyway, so we don't care too much.

sqlalchemy.exc.InvalidRequestError: When initializing mapper mapped class RootStore->root, expression 'ItemStore' failed to locate a name ('ItemStore'). If this is a class name, consider adding this relationship() to the <class 'tests.compiler_test.SqlAlchemyDDLCompilerTest.test_ddl_with_foreign_keys.<locals>.RootStore'> class after both dependent classes have been defined.
@amotl amotl force-pushed the amo/type-float-vector branch from 9557d1c to 36d8b3d Compare June 13, 2024 14:19
@amotl amotl merged commit 47ccba8 into main Jun 13, 2024
23 checks passed
@amotl amotl deleted the amo/type-float-vector branch June 13, 2024 14:19
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.

4 participants