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

PYTHON-1352 Add vector type, codec + support for parsing CQL type #1161

Merged
merged 7 commits into from
Jun 5, 2023

Conversation

absurdfarce
Copy link
Collaborator

No description provided.

@classmethod
def deserialize(cls, byts, protocol_version):
indexes = (4 * x for x in range(0, cls.vector_size))
return [cls.subtype.deserialize(byts[idx:idx + 4], protocol_version) for idx in indexes]
Copy link
Collaborator Author

@absurdfarce absurdfarce May 31, 2023

Choose a reason for hiding this comment

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

Note the explicit assumption here that each element in the vector has a serialized form that is 4 bytes long. This is fine for the initial rollout (which will only include server-side support of float vectors) but needs to be generalized... although it should be noted there's some significant conversation on the Java equivalent of this PR about how to generalize that.

@absurdfarce
Copy link
Collaborator Author

This PR has been vetted by significant use of these changes in internal work on vector support.

@absurdfarce absurdfarce merged commit 2db3728 into master Jun 5, 2023
2 checks passed
@absurdfarce absurdfarce deleted the cep-vsearch branch June 15, 2023 16:14
fruch added a commit to fruch/python-driver that referenced this pull request Jun 6, 2024
…sync_with_upstream_3.29.1

version 3.28.0

* tag '3.28.0' of https://github.com/datastax/python-driver:
  Release 3.28.0: changelog & version
  PYTHON-1352 Add vector type, codec + support for parsing CQL type (datastax#1161)
  Update docs.yaml to point to most recent 3.27.0 docs changes
  CONN-38 Notes for 3.27.0 on PYTHON-1350 (datastax#1166)
  PYTHON-1356 Create session-specific protocol handlers to contain session-specific CLE policies (datastax#1165)
  PYTHON-1350 Store IV along with encrypted text when using column-level encryption (datastax#1160)
  PYTHON-1351 Convert cryptography to an optional dependency (datastax#1164)
  Jenkinsfile cleanup (datastax#1163)
  PYTHON-1343 Use Cython for smoke builds (datastax#1162)
  Don't fail when inserting UDTs with prepared queries with some missing fields (datastax#1151)
  Revert "remove unnecessary import __future__ (datastax#1156)"
  docs: convert print statement to function in docs (datastax#1157)
  remove unnecessary import __future__ (datastax#1156)
  Update docs.yaml to include recent fixes to CLE docs
  Fix for rendering of code blocks in CLE documentation (datastax#1159)
  DOC-3278 Update comment for retry policy (datastax#1158)
  DOC-2813 (datastax#1145)
  Remove different build matrix selection for develop branches (datastax#1138)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant