Skip to content

Adding WITHATTRIBS option to vector set's vsim command. #3746

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

Merged
merged 6 commits into from
Aug 21, 2025

Conversation

petyaslavova
Copy link
Collaborator

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Adding WITHATTRIBS option to vector set's vsim command.
Closes #3743

@petyaslavova petyaslavova requested a review from Copilot August 19, 2025 14:27
@petyaslavova petyaslavova added feature New feature maintenance Maintenance (CI, Releases, etc) labels Aug 19, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds the WITHATTRIBS option to the vector set's vsim command, allowing users to retrieve attributes along with similarity results. This enhances the existing functionality by providing access to metadata associated with vector elements.

Key changes:

  • Adds with_attribs parameter to the vsim command interface
  • Implements parsing logic to handle attribute data in various combinations with scores
  • Updates test suite to cover the new functionality across sync and async clients

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
redis/commands/vectorset/commands.py Adds with_attribs parameter and WITHATTRIBS enum option to vsim command
redis/commands/vectorset/utils.py Implements parsing logic for attribute data in vsim results
tests/test_vsets.py Adds comprehensive test coverage for the new attribute functionality
tests/test_asyncio/test_vsets.py Adds async test coverage mirroring the sync tests
docker-compose.yml Updates Redis test image tags to support new functionality
.github/workflows/integration.yaml Updates CI configuration with new Redis versions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -131,14 +133,34 @@ def vsim(
no_thread: Optional[bool] = False,
epsilon: Optional[Number] = None,
) -> Union[
Awaitable[Optional[List[Union[List[EncodableT], Dict[EncodableT, Number]]]]],
Optional[List[Union[List[EncodableT], Dict[EncodableT, Number]]]],
Awaitable[
Copy link
Collaborator

Choose a reason for hiding this comment

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

This typing looks evil 😆

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, absolutely unreadable... I was thinking to extract a separate type alias for this one and I forgot.. :) Now it's fixed.

@petyaslavova petyaslavova merged commit d24c9c9 into master Aug 21, 2025
124 of 127 checks passed
@petyaslavova petyaslavova deleted the ps_add_withattribs_to_vsim branch August 21, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature maintenance Maintenance (CI, Releases, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please add the new WITHATTRIBS flag to the vsim() function in vectorsets
2 participants