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

don't pass non-JSON specific producer_args to to_json #150

Merged
merged 1 commit into from
Oct 9, 2022

Conversation

djerius
Copy link
Contributor

@djerius djerius commented Oct 4, 2022

The producer_args passed by sqlt contains a number of keys which are not specific to JSON. These were passed unfiltered to to_json(). JSON (at least as of v2.90) will throw an error if it is passed an unknown option (it uses the option key as a method name, which leads to confusing error messages).

It's not straightforward to automatically determine the args supported by the JSON module, so this simply whitelist the 'pretty', 'indent', and 'canonical' options.

The producer_args passed by sqlt contains a number of keys which are
not specific to JSON.  These were passed unfiltered to to_json().
JSON (at least as of v2.90) will throw an error if it is passed an
unknown option (it uses the option key as a method name, which leads
to confusing error messages).

It's not straightforward to automatically determine the args supported
by the JSON module, so this simply whitelist the 'pretty', 'indent',
and 'canonical' options.
@rabbiveesh rabbiveesh merged commit 3f37627 into dbsrgits:master Oct 9, 2022
@djerius
Copy link
Contributor Author

djerius commented Oct 9, 2022

Thanks!

@djerius djerius deleted the json-producer-args branch October 9, 2022 16:41
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