update retrieval of datasets by jobs/tasks#204
Conversation
| def vault_object(self): | ||
| from solvebio import Object | ||
| response = self._client.get( | ||
| os.path.join(Object.class_url(), self['vault_object_id']), {}) |
There was a problem hiding this comment.
I think this should use a urljoin.
|
|
||
| @property | ||
| def dataset_id(self): | ||
| return self['dataset']['id'] |
There was a problem hiding this comment.
I'm surprised there isn't a dataset_id attribute on this object... or is it write only?
There was a problem hiding this comment.
hmm... ya weird. that is there already. removing
| @property | ||
| def dataset(self): | ||
| self._client.Dataset.retrieve(self['dataset']) | ||
| response = self._client.get(self['dataset']['url'], {}) |
There was a problem hiding this comment.
is dataset['url'] a relative URL or absolute?
|
|
||
| @property | ||
| def source(self): | ||
| if not self.source_id: |
There was a problem hiding this comment.
Didn't realize this was possible
There was a problem hiding this comment.
should it raise an exception? return None?
There was a problem hiding this comment.
ya....you are correct...not sure why i did that. serializers have required=True. removing
| if not self.source_id: | ||
| return | ||
|
|
||
| response = self._client.get(self['source']['url'], {}) |
There was a problem hiding this comment.
Same question as above... is it abs. or relative url?
| """ Returns the parent object """ | ||
| if self['parent_object_id']: | ||
| response = self._client.get( | ||
| os.path.join(self.class_url(), self['parent_object_id']), {}) |
| """ Returns the vault object """ | ||
| from . import Vault | ||
| response = self._client.get( | ||
| os.path.join(Vault.class_url(), str(self['vault_id'])), {}) |
There was a problem hiding this comment.
I guess technically you could do Vault.retrieve(id, client=self._client) also
There was a problem hiding this comment.
oh ya, thats cleaner. will do.
…hon into f-dataset-retrieve
| response = self._client.get( | ||
| os.path.join(self.class_url(), self['parent_object_id']), {}) | ||
| return convert_to_solve_object(response, client=self._client) | ||
| return self.retrieve(self['parent_object_id'], client=self._client) |
There was a problem hiding this comment.
since retrieve is a classmethod, should this be Object.retrieve?
| def dataset(self): | ||
| self._client.Dataset.retrieve(self['dataset']) | ||
| response = self._client.get(self['dataset']['url'], {}) | ||
| return convert_to_solve_object(response, client=self._client) |
There was a problem hiding this comment.
Do you think it might be sufficient to do:
return convert_to_solve_object(self['dataset'], client=self._client)?
|
|
||
| @property | ||
| def dataset_id(self): | ||
| return self['dataset']['id'] |
Uh oh!
There was an error while loading. Please reload this page.