Skip to content

Conversation

@justin-cechmanek
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings November 7, 2025 00:54
Copy link
Contributor

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 refactors the HybridQuery class to AggregateHybridQuery to better reflect its implementation using Redis aggregation queries, while maintaining backward compatibility through a deprecation wrapper.

  • Renamed HybridQuery to AggregateHybridQuery with proper deprecation warnings
  • Updated all tests and documentation to use the new class name
  • Added comprehensive backward compatibility tests to ensure the old HybridQuery still 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.

.. 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.",
Copy link

Copilot AI Nov 7, 2025

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).

Suggested change
to maintain current functionality please use AggregateHybridQuery directly.",
to maintain current functionality please use AggregateHybridQuery directly.

Copilot uses AI. Check for mistakes.
text = "with a for but and" # will all be removed as default stopwords
with pytest.raises(ValueError):
hybrid_query = HybridQuery(
hybrid_query = AggregateHybridQuery(
Copy link

Copilot AI Nov 7, 2025

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.

Copilot uses AI. Check for mistakes.

with pytest.raises(TypeError):
hybrid_query = HybridQuery(
hybrid_query = AggregateHybridQuery(
Copy link

Copilot AI Nov 7, 2025

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.

Copilot uses AI. Check for mistakes.

# Verify AggregateHybridQuery does not emit warnings
with assert_no_warnings():
aggregate_query = AggregateHybridQuery(
Copy link

Copilot AI Nov 7, 2025

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.

Suggested change
aggregate_query = AggregateHybridQuery(
AggregateHybridQuery(

Copilot uses AI. Check for mistakes.

# Verify that creating another HybridQuery also warns
with pytest.warns(DeprecationWarning):
another_hybrid_query = HybridQuery(
Copy link

Copilot AI Nov 7, 2025

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.

Suggested change
another_hybrid_query = HybridQuery(
HybridQuery(

Copilot uses AI. Check for mistakes.
# test if text is empty
with pytest.raises(ValueError):
hybrid_query = HybridQuery(
hybrid_query = AggregateHybridQuery(
Copy link

Copilot AI Nov 7, 2025

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.

Copilot uses AI. Check for mistakes.

with pytest.raises(ValueError):
hybrid_query = HybridQuery(
hybrid_query = AggregateHybridQuery(
Copy link

Copilot AI Nov 7, 2025

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.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 7, 2025 00:58
Copy link
Contributor

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

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.",
Copy link

Copilot AI Nov 7, 2025

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 \",.

Suggested change
To maintain current functionality please use AggregateHybridQuery directly.",
To maintain current functionality please use AggregateHybridQuery directly.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@abrookins abrookins left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@justin-cechmanek justin-cechmanek merged commit 407ba1b into main Nov 7, 2025
45 checks passed
@justin-cechmanek justin-cechmanek deleted the feat/RAAE-1133/rename-hybrid-query branch November 7, 2025 14:29
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