pepkit / pipestat

Pipeline results reporting package
https://pep.databio.org/pipestat/
BSD 2-Clause "Simplified" License
4 stars 2 forks source link

Error in retrieving one result in `retrieve_one` #171

Closed khoroshevskyi closed 5 months ago

khoroshevskyi commented 7 months ago

While I try to retrieve one result from one record, I got an error:

Input:

retrieve_one(record_identifier="id1", result_identifier=["description"])

Error:

TypeError: unhashable type: 'list'

We can clean this code by returning this value:

return_result = {key: value for key, value in result[0].items() if key in list(result_identifier)}
khoroshevskyi commented 6 months ago

It can't take a list with a single entity

donaldcampbelljr commented 6 months ago

This is now fixed and I added a test to catch any future regressions.