-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
selectattr
on the nested property, thereby requiring the need to use a for loop or make another API call. This changesselectattr
to use the chain property resolver and modifiesrejectattr
to share code withselectattr
.