-
Notifications
You must be signed in to change notification settings - Fork 60
Renames HybridQuery to AggregateHybridQuery #422
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
Conversation
There was a problem hiding this 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 refactors the HybridQuery class to AggregateHybridQuery to better reflect its implementation using Redis aggregation queries, while maintaining backward compatibility through a deprecation wrapper.
- Renamed
HybridQuerytoAggregateHybridQuerywith proper deprecation warnings - Updated all tests and documentation to use the new class name
- Added comprehensive backward compatibility tests to ensure the old
HybridQuerystill works with deprecation warnings
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
redisvl/query/aggregate.py |
Renamed main class to AggregateHybridQuery and created HybridQuery as a backward compatibility wrapper with deprecation warnings |
redisvl/query/__init__.py |
Exported both AggregateHybridQuery and HybridQuery for backward compatibility |
tests/unit/test_aggregation_types.py |
Updated all test cases to use AggregateHybridQuery and added backward compatibility tests with deprecation warning verification |
tests/integration/test_aggregation.py |
Updated all integration tests to use AggregateHybridQuery and added backward compatibility test |
docs/user_guide/11_advanced_queries.ipynb |
Updated documentation to reference AggregateHybridQuery consistently throughout examples and explanations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
redisvl/query/aggregate.py
Outdated
| .. deprecated:: | ||
| HybridQuery is a backward compatibility wrapper around AggregateHybridQuery | ||
| and will eventually be replaced with a new hybrid query implementation. | ||
| to maintain current functionality please use AggregateHybridQuery directly.", |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a misplaced comma and period at the end of the docstring. The line should end with a period, not directly.", (comma followed by quote and period).
| to maintain current functionality please use AggregateHybridQuery directly.", | |
| to maintain current functionality please use AggregateHybridQuery directly. |
| text = "with a for but and" # will all be removed as default stopwords | ||
| with pytest.raises(ValueError): | ||
| hybrid_query = HybridQuery( | ||
| hybrid_query = AggregateHybridQuery( |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable hybrid_query is not used.
|
|
||
| with pytest.raises(TypeError): | ||
| hybrid_query = HybridQuery( | ||
| hybrid_query = AggregateHybridQuery( |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable hybrid_query is not used.
|
|
||
| # Verify AggregateHybridQuery does not emit warnings | ||
| with assert_no_warnings(): | ||
| aggregate_query = AggregateHybridQuery( |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable aggregate_query is not used.
| aggregate_query = AggregateHybridQuery( | |
| AggregateHybridQuery( |
|
|
||
| # Verify that creating another HybridQuery also warns | ||
| with pytest.warns(DeprecationWarning): | ||
| another_hybrid_query = HybridQuery( |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable another_hybrid_query is not used.
| another_hybrid_query = HybridQuery( | |
| HybridQuery( |
| # test if text is empty | ||
| with pytest.raises(ValueError): | ||
| hybrid_query = HybridQuery( | ||
| hybrid_query = AggregateHybridQuery( |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assignment to 'hybrid_query' is unnecessary as it is redefined before this value is used.
|
|
||
| with pytest.raises(ValueError): | ||
| hybrid_query = HybridQuery( | ||
| hybrid_query = AggregateHybridQuery( |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assignment to 'hybrid_query' is unnecessary as it is redefined before this value is used.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .. deprecated:: | ||
| HybridQuery is a backward compatibility wrapper around AggregateHybridQuery | ||
| and will eventually be replaced with a new hybrid query implementation. | ||
| To maintain current functionality please use AggregateHybridQuery directly.", |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove trailing comma and quotation mark. The docstring should end with a period, not \",.
| To maintain current functionality please use AggregateHybridQuery directly.", | |
| To maintain current functionality please use AggregateHybridQuery directly. |
abrookins
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
No description provided.