-
Notifications
You must be signed in to change notification settings - Fork 0
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
HDX-9984 Allow key specification to be nested #34
Conversation
Pipeline failures are mainly down to the stage API key changing a couple of times! |
…on-api library was updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm glad I got to do this review, it was my first time using the hdx toolkit, and it's really slick, I'll definitely be keeping it in my back pocket!
Overall I think this change is a tricky one because it opens up a lot of different possibilities for queries. Below are some ones that I tried:
First, there appears to be a duplication bug, e.g. the following returns two rows:
hdx-toolkit list \
--dataset_filter=gibraltar-healthsites --hdx_site=stage \
--key=archived,batch
I suspect it comes from using both output and output_row in the query_dict function.
This returns a dictionary that doesn't fit into the table:
hdx-toolkit list \
--dataset_filter=gibraltar-healthsites --hdx_site=stage \
--key=resources \
--with_extras
This returns a too many values error that should perhaps be caught or otherwise handled:
hdx-toolkit list \
--dataset_filter=gibraltar-healthsites \
--hdx_site=stage \
--key=resources.fs_check_info.state \
--with_extras
This returns 5 rows of absent key:
hdx-toolkit list \
--dataset_filter=gibraltar-healthsites \
--hdx_site=stage \
--key=resources.nonsense \
--with_extras
@turnerm here's my response to your test cases:
|
Purpose
Version for this PR: 2024.7.1
This PR provides functionality to access nested keys in the
list
command, typically the nested keys of theorganization
dictionary, or the keys of lists such astags
andgroups
.#5
Major file changes
The major change is the introduction of a new function,
query_dict
which is added toutilities.py
and tested intest_utilities.py
. It is invoked in the "list" command incli.py
:hdx-cli-toolkit/src/hdx_cli_toolkit/cli.py
Line 102 in 28fe9d8
Minor file changes
As a result of changing the global git config handling line endings, all(?) many lines of code appeared to have changed but I believe this is just a line ending change.
Versioning
hdx-cli-toolkit
uses the CalVer versioning scheme with format YYYY.MM.Micro i.e. 2022.12.1 which is updated manually inpyproject.toml
. The "Micro" component is simply an integer increased by 1 at each version, starting from 0.pyproject.toml
and PR description