Skip to content
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

Remove deprecated filters: leaf_paths, recurse_down #2666

Merged
merged 1 commit into from
Jul 7, 2023

Conversation

itchyny
Copy link
Contributor

@itchyny itchyny commented Jul 7, 2023

This PR removes two builtin filters marked as deprecated and will be removed in the next major release. Both of leaf_paths and recurse_down filters were deprecated by #426 (dde43f7) in 2014, and it's already 9 years passed since then. I think we have waited too long and can remove them in the coming next release. Closes #1163 (which is not actually a bug but mentions about the quite confusing definition of leaf_paths so let me close).

@itchyny itchyny added this to the 1.7 release milestone Jul 7, 2023
@nicowilliams nicowilliams merged commit 0eceded into jqlang:master Jul 7, 2023
@nicowilliams
Copy link
Contributor

Thanks!

@uncle-fed
Copy link

@itchyny : could you kindly elaborate why "#1163 is not a bug" and whether the PR here changes the behaviour of paths(scalars) reported in #1163. Thanks a lot!

@nicowilliams
Copy link
Contributor

@itchyny : could you kindly elaborate why "#1163 is not a bug" and whether the PR here changes the behaviour of paths(scalars) reported in #1163. Thanks a lot!

@uncle-fed the issue is that scalars isn't a boolean predicate, so false|scalars emits false, but paths/1 wants a boolean predicate, so paths(false) will not output anything. What you want is paths(scalars|true).

@uncle-fed
Copy link

@nicowilliams : thanks a lot for the clear explanation, finally :-)

My confusion (and you can see that there are quite a few others) comes from encountering the paths(scalars) behaviour, then scratching your head and wondering whether it is a bug (perhaps because the current docs are not quite clear in that regard) coming to GitHub, finding this exact issue and then seeing how the issue is not addressed on the bug tracker for years, assume that 1) it is a bug, and 2) nobody cares. :-)

There are now "bug workarounds" on #1163 such as paths([scalars] != []) , which of course are more complex than the correct usage suggested now, i.e., paths(scalars|true)

And what's worse, there are other bug reports open (also beyond the jq main repository but in other projects that rely on jq) which simply treat #1163 as a bug that needs fixing on the jq side.

I think it would be of a great help if both, the #1163 and the docs were updated with this vital information.

Thank you, as always, for the fantastic tool.

@uncle-fed
Copy link

OK, I see there was now further development of the #1163. Thanks a lot for at least setting the record straight in the original report, finally! ;-)

matthewfeickert added a commit to yadage/packtivity that referenced this pull request Sep 19, 2023
* The 'leaf_paths' filter has been deprecated for 9 years and was
  removed in jqlang v1.7 (jq v1.6) so use the 'paths(scalars)' filter.
   - c.f. jqlang/jq#2666
   - c.f. jqlang/jq#426
* Remove upper bound on jq version
   - Reverts #97
matthewfeickert added a commit to yadage/packtivity that referenced this pull request Sep 19, 2023
* The 'leaf_paths' filter has been deprecated for 9 years and was
  removed in jqlang v1.7 (jq v1.6) so use the 'paths(scalars)' filter.
   - c.f. jqlang/jq#2666
   - c.f. jqlang/jq#426
* Remove upper bound on jq version
   - Reverts #97
matthewfeickert added a commit to yadage/packtivity that referenced this pull request Sep 19, 2023
…ted (#101)

* Backport PR #99
* The 'leaf_paths' filter has been deprecated for 9 years and was removed in jqlang v1.7 (jq v1.6) so use the 'paths(scalars)' filter.
   - c.f. jqlang/jq#2666
   - c.f. jqlang/jq#426
* Remove upper bound on jq version
   - Reverts #97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

paths(scalars) bug?
3 participants