Skip to content
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

Fixed typo and added equivalent test #10

Merged
merged 3 commits into from
Apr 28, 2015
Merged

Conversation

mortenf
Copy link
Contributor

@mortenf mortenf commented Apr 28, 2015

Was thrown off by typo in example: JSON-string wasn't parsed (with text=).

Also added test to illustrate the problem.

Signed-off-by: Morten Høybye Frederiksen <morten@mfd-consult.dk>
@mwilliamson
Copy link
Owner

Thanks for the pull request!

Was thrown off by typo in example: JSON-string wasn't parsed (with text=).

For consistency, I feel like the better fix for the example would be to pass in a plain array i.e. jq(".[]").transform([1, 2, 3], text_output=True) == "1\n2\n3". What do you think?

Also added test to illustrate the problem.

I'm not sure whether this test is necessary: there is already a test for exceptions when programs and inputs are mismatched.

@mortenf
Copy link
Contributor Author

mortenf commented Apr 28, 2015

It's quite fine with the plain array.

And yes, the test isn't necessary (although it does report a different error).

@mwilliamson
Copy link
Owner

And yes, the test isn't necessary (although it does report a different error).

True about the different error, but I'm happy to trust the the original jq library does the right thing with respect to generating errors, just so long as the Python bindings surface those errors correctly.

In which case, do you want to amend the commit in this pull request to use a plain array in the example, and remove the redundant test? Then I think we're good to merge.

Signed-off-by: Morten Høybye Frederiksen <morten@mfd-consult.dk>
Signed-off-by: Morten Høybye Frederiksen <morten@mfd-consult.dk>
@mortenf
Copy link
Contributor Author

mortenf commented Apr 28, 2015

There. :-)

mwilliamson added a commit that referenced this pull request Apr 28, 2015
Fixed typo in example in README.md
@mwilliamson mwilliamson merged commit b403b0c into mwilliamson:master Apr 28, 2015
@mwilliamson
Copy link
Owner

Merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants