Implement nested properties for selectattr and rejectattr filters.#238
Conversation
Codecov Report
@@ Coverage Diff @@
## master #238 +/- ##
===========================================
- Coverage 71.6% 71.6% -0.01%
+ Complexity 1378 1375 -3
===========================================
Files 218 218
Lines 4350 4331 -19
Branches 689 683 -6
===========================================
- Hits 3115 3101 -14
+ Misses 999 996 -3
+ Partials 236 234 -2
Continue to review full report at Codecov.
|
boulter
left a comment
There was a problem hiding this comment.
Looks OK mod one comment. What is the problem this is solving? Some examples would help. Do we need to update documentation?
| if (expTest.evaluate(attrVal, interpreter, expArgs)) { | ||
| Object attrVal = new Variable(interpreter, String.format("%s.%s", "placeholder", attr)).resolve(val); | ||
| boolean pass = expTest.evaluate(attrVal, interpreter, expArgs); | ||
| if ((acceptObjects && pass) || (!acceptObjects && !pass)) { |
There was a problem hiding this comment.
could just do acceptObjects == pass
|
Anthony mentioned he would update the public documentation. When using |
|
Ok, I get it now. This allows you to filter by |
|
Yep 👍 On the HubSpot side, it will encourage people to use HubL instead of multiple API calls to do filtering on HubDB rows. |
Continuation of #183 to make these filters expressive. Previously if you had a nested object there would be no way to
selectattron the nested property, thereby requiring the need to use a for loop or make another API call. This changesselectattrto use the chain property resolver and modifiesrejectattrto share code withselectattr.