genialis / resolwe-bio-py

Resolwe Bioinformatics Python API
Apache License 2.0
4 stars 25 forks source link

Error in Collection.remove_data("slug") #65

Closed mstajdohar closed 7 years ago

mstajdohar commented 7 years ago

Removing data from collections by slug does not work. It does work if data object is specified by its ID.

Error:

ResloweServerError: ValueError at /api/collection/2/remove_data invalid literal for int() with base 10: 'hg19'

Fails for:

In [10]: c.remove_data('data-11')
---------------------------------------------------------------------------
ResloweServerError                        Traceback (most recent call last)
<ipython-input-10-798cccd2ab41> in <module>()
----> 1 c.remove_data('data-11')

/Users/janez/resolwe-bio-py/resdk/resources/collection.pyc in remove_data(self, *data)
     57         """Remove ``data`` objects from the collection."""
     58         data = [get_data_id(d) for d in data]
---> 59         self.api(self.id).remove_data.post({'ids': data})
     60         self._clear_data_cache()
     61

/Users/janez/resolwe-bio-py/resdk/exceptions.pyc in wrapper(*args, **kwargs)
     33             return func(*args, **kwargs)
     34         except SlumberHttpBaseException as exception:
---> 35             raise ResloweServerError(exception.content)  # pylint: disable=no-member
     36
     37     return wrapper

ResloweServerError: <h1>Server Error (500)</h1>
mstajdohar commented 7 years ago

@dblenkus What is the status of this?

dblenkus commented 7 years ago

It was agreed that this functions should work by id or actual data object. I can probably add slug quite easy, but it should be planned before.

mstajdohar commented 7 years ago

Not needed.