You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The python API client now has Model-specific docs for every Model it supports. While the examples for get_by_id do contain working code, it would be great if the queries they imply would actually return data instead of None. This is done in the case of find to some extent.
Right now, for the majority of Models, the example in Model.get_by_id uses id=1, which will return None for most models, because that ID in most cases is not used.
If I remember correctly, some of the IDs may not be stable (i.e. they may change over time), so manually defining these once would be fragile.
It might be possible for the code generator to find the first instance of each model type and use that ID value, but that would also need to be run any time those IDs actually change, so might not be much better (unless we only expect ID value changes to coincide with API releases, in which case we could just re-run code generation at release time).
That's true, but at least for Depositions, Datasets, Runs, and Tomograms I believe IDs should be pretty stable by now. I think in those cases (which I expect would be the most frequently used) we could use working IDs.
@dgmccart had mentioned you might have a number that works everytime (something like 10000) but I can't reproduce that. I also looked at the test_get_by_id.py file which lists 20001 for the Dataset object but that doesn't seem to work for me either??
The python API client now has
Model
-specific docs for everyModel
it supports. While the examples forget_by_id
do contain working code, it would be great if the queries they imply would actually return data instead ofNone
. This is done in the case offind
to some extent.Right now, for the majority of
Models
, the example inModel.get_by_id
usesid=1
, which will returnNone
for most models, because that ID in most cases is not used.To reproduce:
Returns:
The text was updated successfully, but these errors were encountered: