-
Notifications
You must be signed in to change notification settings - Fork 196
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
Implemented update method on most JSONPath descendents. Tests included. #28
Conversation
Is there a reason why this hasn't been merged in to the master branch? |
@joshbenner from jsonpath_rw import parse
jsonpath_expr = parse('$..baz')
data = {'foo': [{'baz': 1}, {'baz': 2}]}
jsonpath_expr.update(data, '1234')
assert data == {'foo': [{'baz': 1234}, {'baz': 1234}]} |
At a high level, I'd kind of like to reserve the word |
More tests, such as those with lists within dictionaries and vice versa, would be nice. |
I believe it is very handy PR, can anyone tell me what is needed to merge it? |
+1 this will also update passing lambdas instead of the value? if not, that's a great enhancement |
Should we believe this PR could be aprooved? |
+1 |
+1. Useful feature. |
+1 |
Thanks for this update. BTW, does this allow removal of a selected element? |
I'm seeing
|
The reason you are getting the NotImplementedError is because the current version (1.4.0) on PyPi predates this pull request. |
Hello... I see the "raise NotImplementedError(), NotImplementedError" when I tried using the update method to change json elements. Is there a work-around for this? |
Are the plans to cut a new release soon with the |
It has been so long since I did a pypi release I don't remember how ;_; |
Mostly addresses #21. I didn't add update() implementations for Parent, Union, or Intersect, as I wasn't sure it made sense to do so. More esoteric test cases might be good, too, as I'm not 100% sure the implementations work as expected at all times.