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

Update Python imports (index_definition => indexDefinition) #3490

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

dwdougherty
Copy link
Contributor

@dwdougherty dwdougherty commented Jan 30, 2025

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)?
  • Was the change added to CHANGES file?

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

Description of change

A customer tried to run some of the query_* tests and got tripped up on the import for IndexDefinition. This PR fixes those imports.

Fixes redis/docs#1097

@petyaslavova
Copy link
Collaborator

Hi @dwdougherty, this class name was changed as part of #3469. It is related to the upcoming new release. The examples for the older versions should be inspected from the version's branches, where the breaking changes are not merged.

@dwdougherty
Copy link
Contributor Author

Hi @petyaslavova. I'm sorry, but I'm not following you. Are you saying that this PR isn't correct and can't be merged? Currently, the code examples on redis/docs are broken because of bad imports. The only way to fix this is to fix the doctests in this repo. What are you advising?

Cc: @uglide

@petyaslavova
Copy link
Collaborator

@dwdougherty if the tests are executed with the current library code from the master branch installed locally they should not fail.
You can verify this by running 'invoke package; pip install .' in the redis-py root dir (after all dependencies are installed)- this will install the current state of the code in your Python environment.
The current file name in the examples matches the file name in the code.

@dwdougherty
Copy link
Contributor Author

dwdougherty commented Feb 3, 2025

This PR was the result of a community report. Is it likely that customers will use redis-py this way? I'd expect that most folks would install redis-py via the PYPI market place.

@petyaslavova
Copy link
Collaborator

Hi @dwdougherty, You are right about that. To make the doctests compatible with the latest released library version, this change should be merged. However, we should keep in mind that the rename should be applied again after the library version containing the latest code is released.

Copy link
Collaborator

@petyaslavova petyaslavova left a comment

Choose a reason for hiding this comment

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

LGTM.

@petyaslavova petyaslavova merged commit b7d4c48 into redis:master Feb 4, 2025
35 checks passed
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.

Feedback: Redis as a vector database quick start guide
2 participants