Skip to content
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

Convert_json_to_baton_objs doesn't convert correctly, as replicas are not within the output #14

Closed
irinaColgiu opened this issue Jul 8, 2016 · 2 comments

Comments

@irinaColgiu
Copy link
Contributor

For some reason, the output of the following doesn't contain any information about the replicas:

json_ob = '{"collection": "/seq/16006", "data_object": "16006_5.cram", "replicate": [{"checksum": "b92764c24d3346231fd8ef9fdb599df3", "number": 0, "valid": true}, {"checksum": "b92764c24d3346231fd8ef9fdb599df3", "number": 2, "valid": true}]}'
print("Converted json: %s" % convert_json_to_baton_objs(json_ob))

OUTPUT:

[<<class 'baton.models.DataObject'> object at 140404288519248: { _access_controls: None, metadata: None, path: /seq/16006/16006_5.cram, replicas: None }>]

@colin-nolan
Copy link
Contributor

The first issue is with the example. The string assigned to json_ob is not valid baton JSON: baton uses the property replicates, not replicate (I think the property should be replicas but I digress...).

Once that has been corrected for however, there is a problem with the baton Python library as it assumes that timestamp information is given if along with the replica information:
https://github.com/wtsi-hgi/python-baton-wrapper/blob/a97af16b1435c8693c48aa6dfcc889e6c916f933/baton/_baton/json.py#L195
i.e. it is expecting baton-list --replicate --timestamp to be used.

The reason why timestamp information is being required here is because baton uses a questionable representation of replicas, in which their information is not contained in a single object: wtsi-npg/baton#146.

I have put an issue in for this on the baton wrapper:
wtsi-hgi/python-baton-wrapper#38

@colin-nolan
Copy link
Contributor

The issue with the baton wrapper has been fixed :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants