-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add builtin function compact
#2838
base: master
Are you sure you want to change the base?
Conversation
Implementation LGTM but i guess we have to decide if it goes into 1.7 or not? as i understood around the discussion about |
You have to also include a regen of |
`compact` removes nulls from an object.
I personally think that it's fine to go into 1.7 unless we think 1.7 should have zero new feature.
Fixed in 04a0dc5 This PR is ready for review again 😄 |
@owenthereal wrote:
I am not sure whether the above refers to the behavior of Consider in particular the fact that This behavior fits in properly with the jq scheme of things, as evidenced for example by the way it flows from the simplicity of the def of On the other hand, it might make sense for |
@wader wrote:
My thinking is that it shouldn't, partly because we're already at jq 1.7rc2, but mainly because there hasn't been much discussion about it. Should we have guidelines as to when new trivial builtins should be added? In any case, it is very specific: in my experience, different users typically want to delete various combinations of distinguished values besides |
Personally, I think just |
I tend to agree. I'm not sure I'd know what |
compact
removes nulls from an object.