We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
pyjq==2.4.0 jq version: 1.6
I wanna filter some certain objects with jq. Seems there's a bug with map_values function.
With jq, it works fine:
echo '{"a": {"status": 1, "elapsed": 12}, "b": {"status": 0, "elapsed": 11}}' | jq 'map_values(select(.status==1))' returns: { "a": { "status": 1, "elapsed": 12 } }
But with pyjq:
data={"a": {"status": 1, "elapsed": 12}, "b": {"status": 0, "elapsed": 11}} pyjq.first('map_values(select(.status==1))', data)
returns None
None
Try pyjq.first('map_values(select(.status<1))', data)
pyjq.first('map_values(select(.status<1))', data)
returns {'b': None}
{'b': None}
The text was updated successfully, but these errors were encountered:
pyjq.first('to_entries| map(select(.value.status==1))', data) will work
pyjq.first('to_entries| map(select(.value.status==1))', data)
Sorry, something went wrong.
No branches or pull requests
pyjq==2.4.0
jq version: 1.6
I wanna filter some certain objects with jq. Seems there's a bug with map_values function.
With jq, it works fine:
But with pyjq:
returns
None
Try
pyjq.first('map_values(select(.status<1))', data)
returns
{'b': None}
The text was updated successfully, but these errors were encountered: