Skip to content

Commit

Permalink
id list
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencarlislewalker committed Sep 12, 2024
1 parent 3dead36 commit f21cb31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/iidda_api/get_dataset_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_dataset_list(clear_cache, response_type="metadata", subset="all"):
Args:
clear_cache (bool): clears all cache stored in the cache backend
response_type (str, optional): Type of information stored in the dictionary. Acceptable values include "columns", "csv_dialect", "data_dictionary", "github_url", "metadata". Defaults to "metadata".
response_type (str, optional): Type of information stored in the dictionary. Acceptable values include "columns", "csv_dialect", "data_dictionary", "github_url", "metadata", "dataset_ids". Defaults to "metadata".
subset (str or List(str), optional): List of dataset ID strings, or "all" to return all datasets. Defaults to "all".
Returns:
Expand Down
8 changes: 5 additions & 3 deletions python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ async def metadata(
default=None, description="Return metadata for the datasets specified."),
jq_query: str = Query(None, description="JSON filter written in jq notation. Filter is applied to the metadata of the selected response_type. Cannot be used in conjuction with dataset_ids, key, and metadata_search parameters. Docs: https://stedolan.github.io/jq/"),
response_type=Query("metadata", enum=sorted(
["github_url", "metadata", "csv_dialect", "data_dictionary", "columns", "ids"]))
["github_url", "metadata", "csv_dialect", "data_dictionary", "columns", "dataset_ids"]))
):
"""
Get metadata for datasets. There are 3 ways to filter datasets; they cannot be used in conjuction:
Expand All @@ -186,8 +186,10 @@ async def metadata(

dataset_list = dataset_list_search(
dataset_ids, key, metadata_search, None, string_comparison)

return get_dataset_list(clear_cache=False, response_type=response_type, subset=dataset_list)
return_dataset_list = get_dataset_list(clear_cache=False, response_type=response_type, subset=dataset_list)
if response_type == "dataset_ids":
return_dataset_list = list(return_dataset_list.keys())
return return_dataset_list
signal.alarm(0)

print("Defining data dictionary...")
Expand Down

0 comments on commit f21cb31

Please sign in to comment.