-
-
Notifications
You must be signed in to change notification settings - Fork 6
Python JSONPath Version 2 #98
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
base: main
Are you sure you want to change the base?
Conversation
Some JSONPath performance notes, before attempting any new optimizations. This benchmark is run on lots of small JSONPath queries with small data. Main branch (89c0e7e)
v2 branch (e41ec29)
|
I am testing my Lexer against your test_lex.py code. It's still a work in progress. But I have converted your test data into a json file. You can get it here . The only changes I made are :
I'll probably be converting more of your tests like this as I proceed. It would make a little more work for you on your end to use them, as you'd have to write a load() method to deserialize them. But it would help us both out in the long run as we could each capture new bugs in the same file without having to modify any python code. And it would help me as you add new features, as I could use test-driven development with updated versions of the file after you introduce new features. I hope this is useful!
|
Looks good 👍 I do like "golden files", especially when they apply to multiple projects. Notice that this pull request - on the v2 branch - has changed tokens produced by the lexer quite a bit. Don't feel obliged to follow v2 instead of main, but it does fix some of the inconsistencies you pointed out in our previous discussions. And, with these changes, we will be able to configure JSONPath to strictly follow RFC 9535 without exception. |
Well it didn't take me long to sour on that idea of wrapping the tokens in a Map. It literally doubles the amount of code I have to write in Java to deserialize it. lol. It's extra characters and thus file size in the json file. So I'm redoing it to be a simpler JSON format, which will also make it easier to load in Python. I can migrate test_lex.json to use the JSON file. I'll probably work on it tomorrow. For me. |
Looking ahead to Python JSONPath version 2, this PR includes breaking changes for both the Python API and some subtle changes to the default JSONPath syntax. We have:
More changes to follow before release:
shorthand
arguments to some selector classes. We no longer need them.regex
package instead ofre
formatch
andsearch
function extensions.