-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
Hello.
I am having the following issue regarding the use of vars argument.
This does not work:
data = dict(
parameters= [
dict(name="PKG_TAG_NAME", value="trunk"),
dict(name="GIT_COMMIT", value="master"),
dict(name="TRIGGERED_JOB", value="trunk-buildall")
],
id="2013-12-27_00-09-37",
changeSet=dict(items=[], kind="git"),
)
import pyjq
print(pyjq.first('$parameters[] | {"param_name": .name, "param_type": .type}', vars=data))
# returns Assertion failed: (JVP_HAS_KIND(key, JV_KIND_STRING)), function jv_object_set, file jv.c, line 1771.But this works:
data = dict(
parameters= [
dict(name="PKG_TAG_NAME", value="trunk"),
dict(name="GIT_COMMIT", value="master"),
dict(name="TRIGGERED_JOB", value="trunk-buildall")
],
id="2013-12-27_00-09-37",
changeSet=dict(items=[], kind="git"),
)
import pyjq
print(pyjq.first('.parameters as $parameters | $parameters[] | {"param_name": .name, "param_type": .type}', data))
# {'param_name': 'PKG_TAG_NAME', 'param_type': None}Am I assuming something wrong regarding the use of vars?
I am using Python 3.11 and pyjq 2.6.0 in a Macbook M2.
Thank you in advance.
Metadata
Metadata
Assignees
Labels
No labels