jmespath-community / python-jmespath Goto Github PK
View Code? Open in Web Editor NEWPython implementation of JMESPath
Home Page: http://jmespath.site
License: MIT License
Python implementation of JMESPath
Home Page: http://jmespath.site
License: MIT License
See jmespath-community/jmespath.test#35
Credits: Reported by Dmitriy on Gitter.
A custom function with no arguments or an empty arguments list cannot be defined as it crashes.
Consider the following function:
@functions.signature()
def _func_now_ts(self):
return "nowTs"
Here is the offending code:
jmes_options = jmespath.Options(dict_cls=collections.OrderedDict, custom_functions=CustomFunctions())
print([jmespath.search](http://jmespath.search/)('now_ts()', {}, jmes_options))
The code uses a Scope()
object with pushScope()
and popScope()
methods.
However, popScope()
is never called.
As a result, the following expression, for instance, is broken:
search( let({root: 'root'}, &root).root, {} )-> null
It currently returns "root"
instead of null
.
Please, consider changing the Scope()
object behaviour to an immutable state.
This project needs an official maintainer.
As this project is now under the JMESPath Community organization, it does not run the risk of becoming stale in the future.
If someone wants to carry this project forward, please let me know in the responses below.
I have not officially created a Maintainer’s Covenant with respect to projects within this organization but the gist of it is pretty simple: this project must be reasonably maintained.
If at any point a maintainer wants to step down, that‘s fine.
The burden can be transferred to someone else.
If you feel you cannot commit to maintain this implementation but would help contribute anyway, please be aware that we also look for maintainers to the JMESPath Community site itself.
In most implementations, the rhs of a sub-expression
is implemented differently when the lhs is a projection.
Due to the shape of the AST, the lhs is actually evaluated on the lhs projection.
However, when slicing a string, the rhs should be treated as a regular sub-expression.
As a result, in most implementations, the following expression does not evaluate correctly:
'foo'[::-1].length(@)
should evaluate to 3
.In some implementations, the result is ``"oof"or
null`.
Please, consider adding a compliance test.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.