Skip to content

Conversation

caseyclements
Copy link
Contributor

Backward-compatible change of Binary.from_vector to take the BinaryVector dataclass as an alternative to separate list, dtype, and padding.

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

LGTM!

@caseyclements caseyclements merged commit 26a61c8 into mongodb:master Oct 23, 2024
27 of 30 checks passed
padding: int = 0,
vector: Union[BinaryVector, list[int, float]],
dtype: Optional[BinaryVectorDtype] = None,
padding: Optional[int] = None,
Copy link
Member

Choose a reason for hiding this comment

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

Using a typing overload could be a cleaner solution here. Then you could properly convey to the type checker that dtype is required when vector is a list.

@caseyclements caseyclements changed the title PYTHON-2926 Updated signature of Binary.from_vector to take a BinaryVector DRIVERS-2926 Updated signature of Binary.from_vector to take a BinaryVector Oct 23, 2024
@caseyclements caseyclements changed the title DRIVERS-2926 Updated signature of Binary.from_vector to take a BinaryVector PYTHON-4903 Updated signature of Binary.from_vector to take a BinaryVector Oct 23, 2024
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.

3 participants