Commit 46b7f7b
authored
[MPT-18174] Fix any and all with multiple nested conditions for a collection (#214)
Any and all are treating nested conditions incorrectly. It wraps entire
set of conditions, instead of properly using collection name:
Collection Name is used because inferring possible collections in query
values is complex and prone to inference errors. Simplest and safest way
I can think of is using collection name.
https://softwareone.atlassian.net/browse/MPT-18174
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
Closes [MPT-18174](https://softwareone.atlassian.net/browse/MPT-18174)
- Fix nested condition handling for any() and all(): these methods now
require an explicit collection_name and build nested expressions using
that collection instead of wrapping the entire condition set.
- Public API changed: RQLQuery.any(collection_name) and
RQLQuery.all(collection_name) now require a collection/path argument
(no-argument forms removed).
- Added internal _nest helper to compose collection-scoped nested
expressions (e.g., any(saleDetails,gt(orderQty,1))).
- Multi-condition queries now format correctly for collections (e.g.,
all(saleDetails,and(gt(orderQty,1),lt(price,100)))).
- Tests updated to validate explicit collection-name usage and multiple
nested condition scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
[MPT-18174]:
https://softwareone.atlassian.net/browse/MPT-18174?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQFile tree
2 files changed
+49
-12
lines changed- mpt_api_client/rql
- tests/unit/rql/query_builder
2 files changed
+49
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
| 260 | + | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
263 | 266 | | |
264 | 267 | | |
265 | 268 | | |
266 | 269 | | |
267 | | - | |
268 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
269 | 274 | | |
270 | | - | |
| 275 | + | |
271 | 276 | | |
272 | | - | |
| 277 | + | |
273 | 278 | | |
274 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
275 | 283 | | |
276 | 284 | | |
277 | 285 | | |
278 | | - | |
279 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
280 | 291 | | |
281 | | - | |
| 292 | + | |
282 | 293 | | |
283 | 294 | | |
284 | 295 | | |
| |||
522 | 533 | | |
523 | 534 | | |
524 | 535 | | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments