-
Notifications
You must be signed in to change notification settings - Fork 2
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
dataset get file list broken for v2, route changed on v2 backend #100
dataset get file list broken for v2, route changed on v2 backend #100
Conversation
…s related to the pagination, and the data is the actual list of files. We want to get the list of files here only, or else other parts of the code will break.
pyclowder/datasets.py
Outdated
@@ -128,7 +128,7 @@ def get_file_list(connector, host, key, datasetid): | |||
datasetid -- the dataset to get filelist of | |||
""" | |||
client = ClowderClient(host=host, key=key) | |||
file_list = datasets.get_file_list(connector, client, datasetid) | |||
file_list = datasets.get_file_list(connector, client, datasetid)['data'] |
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.
shouldn't this change be in pyclowder/v2/datasets.py
rather than here? i dont think the v1 endpoint will have a data field, so it might break back compatibility
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.
This should be fixed now.
Just needs to be rebased but works! 😄 |
…-of-list-of-files
To replicate the bug:
Run a dataset extractor (I ran the huggingface ray extractor.)
In connectors._build_resource these lines cause an error:
This is because what is returned by the /files endpoint in the dataset router has changed. Before it was just a list of files, and now the response is the Paged response, which contains a "metadata" and "data." When it tries to find the f["id"] in those objects, it is not there so it throws an error.
My fix will be to have datasets.get_file_list to return the files, which is the "data" field coming from the backend route.