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

fix: 'get' command on array of tables #32

Merged
merged 1 commit into from
Jun 22, 2024

Conversation

limaa
Copy link
Contributor

@limaa limaa commented Jun 21, 2024

'Getting' an array of tables would print a tomlkit object, namely a tomlkit.items.AoT, instead of printing a json string.

$ toml get person.vehicles
<AoT [{'model': 'Golf', 'year': 2020}, {'model': 'Prius', 'year': 2016}]>

The easiest way I could find to cover all tests was to convert the tomlkit.items.* object into their pure python object with .unwrap() and print that instead.

'Getting' an array of tables would print a tomlkit object, namely a [`tomlkit.items.AoT`](https://tomlkit.readthedocs.io/en/latest/api/#tomlkit.items.AoT), instead of printing a json string.

```sh
$ toml get person.vehicles
<AoT [{'model': 'Golf', 'year': 2020}, {'model': 'Prius', 'year': 2016}]>
```

The easiest way I could find to cover all tests was to convert the `tomlkit.items.*` object into their pure python object with `.unwrap()` and print that instead.
@mrijken
Copy link
Owner

mrijken commented Jun 22, 2024

Thanx!

@mrijken mrijken merged commit 6e7c5cf into mrijken:master Jun 22, 2024
1 check passed
@limaa limaa deleted the fix/get-command-array-of-tables branch June 27, 2024 18:38
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.

2 participants