athenacli
athenacli copied to clipboard
json output format
This output list is exhaustive, and json is not supported today, right?
When I try --table-format "json", I get unrecognized format_name "json". It seems weird to me that html is supported but not just json.
The list in the docs in not exhaustive, but the comment in the CLI config file should be:
https://github.com/dbcli/athenacli/blob/c9e477447345a28b070badb014bfd2c6679cc902/athenacli/athenaclirc#L45-L49
athenacli uses cli_helpers to do output formatting, which in return uses tabulate. https://pypi.org/project/tabulate/.
json is not supported by tabulate, I would guess because it's not really a tabular format.
@mooreniemi thanks for the feedback. Unfortunately, we don't support json format now. I think that's the great idea to support it.
Ok, I am not sure I will have time but if you point me to where a potential refactoring point is to add it, I may be able to help.
@mooreniemi You would add a new adapter here:
https://github.com/dbcli/cli_helpers/tree/main/cli_helpers/tabular_output
For an example, take a look at this PR, which was adding a tsv adapter:
https://github.com/dbcli/cli_helpers/pull/47