-
Notifications
You must be signed in to change notification settings - Fork 13
Add handy shortcut to match string path #25
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
Conversation
|
@dangra I think the thought behind this is fine, please make sure the pipeline passes. |
|
@dangra can you make a test to cover the code? either add the call to
|
|
Yes, I will once I have a free minute in front of the keyboard. Wait for it
this week. Thanks for the heads up
…On Sun, Jun 9, 2019, 00:00 David Brown ***@***.***> wrote:
@dangra <https://github.com/dangra> can you make a test to cover the
code? either add the call to
https://github.com/pacifica/python-jsonpath2/blob/2d74af236c86b51256d5f4d8686183ebcf33252e/jsonpath2/test/jsonpath2_test.py#L712
or make another method and call your match function?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25?email_source=notifications&email_token=AAAJD6K2CDEJF7YISXSKJETPZRW4JA5CNFSM4HTOSHYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXICOWA#issuecomment-500180824>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAJD6JQFQSKGE2X7XTVF4TPZRW4JANCNFSM4HTOSHYA>
.
|
dmlb2000
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
|
@dangra Forgot to add a bit to the README to document the new method. Could you add that? |
This change aims to avoid the boilerplate of applying a JsonPath to a document
```python
>>> import jsonpath2 as jsonpath
>>> doc = {'hello': 'Hello, world!'}
>>> [m.current_value for m in jsonpath.match('$["hello"]', doc)]
```
It resembles the use of `re` module in `re.match(pattern, string)` vs `re.compile(pattern).match(string)`
|
@dmlb2000 I think I broke your accepted review by force pushing a rebase to cleanup commit history. Feel free to review again and merge. thanks |
dmlb2000
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dangra looks good to me, should be able to merge and pull a release out of it soon. I'll want to setup the readthedocs integration and move some files around before that but this will be cut as a release soon.
[WIP] Opened to measure acceptance by maintainers.
Tests and docs will be updated once API is agreed (if any)
Description
This change aims to avoid the boilerplate of applying a JsonPath to a document
It resembles the use of
remodule inre.match(pattern, string)vsre.compile(pattern).match(string)Issues Resolved
None.
Check List