Open kenara opened 3 months ago
kenara wrote at 2024-5-25 07:39 -0700:
This PR addresses the issue of empty queries in the ZCatalog returning no results without explicit feedback. It proposes raising a
ValueError
when an empty query is detected, providing clear feedback to developers.
The catalog usually returns the intersection of the subquery results.
As a consequence, an empty query should return all possible
results (as ZCatalog
did in its early days).
Summary
This PR addresses the issue of empty queries in the ZCatalog returning no results without explicit feedback. It proposes raising a
ValueError
when an empty query is detected, providing clear feedback to developers.Background
In the current implementation of ZCatalog in Zope 4 and 5, an empty query returns no results without any indication to the user. This behavior can be confusing and complicates debugging.
Justification
Changes
searchResults
method to raise aValueError
when an empty query is detected.Benefits
Impact