Hi, I am wondering if the Meltano SDK supports the...
# troubleshooting
s
Hi, I am wondering if the Meltano SDK supports the jsonpath extended parser - which supports filtering. When I tried to use a JSON Path expression like this
$.link[?(@.relation=='next')].url
it complains with an error
Copy code
Extract failed (1): jsonpath_ng.exceptions.JsonPathLexerError: Error on line 1, col 7: Unexpected character: ?
From reading up on the error message it seems there is two options for parsing. The option that supports filtering comes from extensions. This link describes the same issue Example with same issue and solution . The jsonpath_ng documentation also describes the extended parser here. It suggests the following to use the extended parser.
Copy code
from jsonpath_ng.ext import parse
Does the jsonpath helper in the SDK need to be changed to support JSON Path filter or do you think there is another issue? P.S. The jonpath expression works okay on jsonpath.com Thanks Steve
e
Hi @steve_clarke, thanks for reporting! I think the SDK should support this, so I popped an issue: https://gitlab.com/meltano/sdk/-/issues/361
MR was straightforward following the recommendations in the linked issue. Let me know if the test case covers your use 🙂
s
Hi @edgar_ramirez_mondragon, thanks very much for pulling together that MR. I have looked at the commit changes and what you have implemented was very much in-line with my thinking. I'm going to do some more testing tomorrow, maybe I could change the TAP to pull in from your branch - do you think that is possible? Thanks again.
e
maybe I could change the TAP to pull in from your branch - do you think that is possible?
Yup that's perfectly possible with a git ref pointing to the branch:
poetry add git+<https://gitlab.com/meltano/singer-sdk@361-jsonpath-extensions>
We can also publish a PyPI pre-release from the branch
@steve_clarke Alright, you can try with
0.4.5.dev2328572629
s
Thanks very much @edgar_ramirez_mondragon, will do some testing today and let you know how I get on.