-
Notifications
You must be signed in to change notification settings - Fork 168
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
Python Booleans and Filter base with parsing #523
Python Booleans and Filter base with parsing #523
Conversation
Thanks for the contribution. Could you break out the YAML filters into their own PR? |
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.
Thanks!
src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java
Outdated
Show resolved
Hide resolved
Take a look at this, I'll open PR for YAML after this |
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 pretty good. I have a few small comments.
It is a pretty low-level change though so we will have to be careful about rolling this out.
src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java
Outdated
Show resolved
Hide resolved
import java.util.Map; | ||
import org.junit.Test; | ||
|
||
public class AbstractFilterTest extends BaseInterpretingTest { |
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.
nice tests, thank you.
src/test/java/com/hubspot/jinjava/lib/filter/AbstractFilterTest.java
Outdated
Show resolved
Hide resolved
Absolutely, if you have a perf test to compare before/after that would be good |
I'm less concerned about performance than compatibility with existing templates and unknowns. We can see how it goes. |
Prettier reported no changes for me. |
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.
just a few more nits. Thanks again.
src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java
Outdated
Show resolved
Hide resolved
…r.filter(varargs) for backward compatibility
Doesn't seem to work on Windows but OK with WSL. NodeJS executable is an odd dependency.
I've implemented the As this change is only applied to 2 filters, the rest can be modified when needed. e.g. Filters with single param will work without an issue, however where >1 params are involved further testing is warranted. |
@mattcoley any concerns? |
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.
🆒 LGTM
This change includes the following
True
andFalse
are added intoExtendedParser
AbstractFilter
that can be used for simpler filters which works by introspectingJinjavadoc.params
section with some automatic conversions