| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…brid queries
`HybridQuery.rrf_ranking_alpha` is an optional float that defaults to
`None`. Two call sites in `matching_engine_index_endpoint.py` previously
gated RRF wiring on the truthiness of this field
(`if query.rrf_ranking_alpha`), which incorrectly treated an explicit
`0.0` the same as an unset value. As a result, callers passing
`rrf_ranking_alpha=0.0` (pure sparse ranking) had the `rrf` submessage
silently omitted from the outgoing request, and the server fell back to
its default alpha instead of honoring the caller's intent.
Switch both sites to `is not None` so `0.0` is preserved end-to-end:
- `find_neighbors` (public path, `FindNeighborsRequest.Query.RRF`)
- `match` (private-service-access path, `MatchRequest.RRF`)
Extend `_TEST_HYBRID_QUERIES` with a sparse-only entry that sets
`rrf_ranking_alpha=0.0`, and update the two consumers
(`test_private_service_access_hybrid_search_match_queries` and
`test_index_public_endpoint_find_neighbors_queries`) to assert that the
resulting RPC contains `rrf { alpha: 0.0 }` (instead of no rrf at all).
Also switch the expected-side predicate in the private-service-access
test from truthiness to `is not None` for consistency with the SDK.
FUTURE_COPYBARA_INTEGRATE_REVIEW=#6967 from googleapis:release-please--branches--main 4a0d1d2
PiperOrigin-RevId: 948540018
|
This google-contributor PR has been inactive for 14 days. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
fix: Preserve rrf_ranking_alpha=0.0 in MatchingEngineIndexEndpoint hybrid queries
HybridQuery.rrf_ranking_alpha is an optional float that defaults to
None. Two call sites in matching_engine_index_endpoint.py previously
gated RRF wiring on the truthiness of this field
(if query.rrf_ranking_alpha), which incorrectly treated an explicit
0.0 the same as an unset value. As a result, callers passing
rrf_ranking_alpha=0.0 (pure sparse ranking) had the rrf submessage
silently omitted from the outgoing request, and the server fell back to
its default alpha instead of honoring the caller's intent.
Switch both sites to is not None so 0.0 is preserved end-to-end:
Extend _TEST_HYBRID_QUERIES with a sparse-only entry that sets
rrf_ranking_alpha=0.0, and update the two consumers
(test_private_service_access_hybrid_search_match_queries and
test_index_public_endpoint_find_neighbors_queries) to assert that the
resulting RPC contains rrf { alpha: 0.0 } (instead of no rrf at all).
Also switch the expected-side predicate in the private-service-access
test from truthiness to is not None for consistency with the SDK.
FUTURE_COPYBARA_INTEGRATE_REVIEW=#6967 from googleapis:release-please--branches--main 4a0d1d2