-
Notifications
You must be signed in to change notification settings - Fork 10
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
Update dataset requires updating the entire dataset #58
Comments
Thanks for the issue, @dylanmcreynolds. Would you make the new methods take simple dicts as arguments (no model validation) or modify the models to make all fields optional? Some other things I noticed experimenting with the API:
I should also mention I'm testing against backend v3. I'm not sure if the field validation changed in v4. |
I think we should make models that mimic the models that the server enforces. Random dicts could pass client validation but then fail on the server. The way I read the server's openapi spec, the server can take |
Yeah, this is tricky, but your observations about history and such may not apply to v4. The models I referenced in my previous comment really may only apply to v4 backend, which is we would point this enhancement. |
Update methods should really take partial models with all-optional contents (SciCatProject#58). Rather than fixing that issue, let's just ignore the typing error for now.
When doing an update I expected to be able to pass very minimal information to scicat. For instance, to change some metadata, my first try was calling client.update_dataset(Dataset(scientificMetadata= {"newkey":"newval"}, pid) . This fails because
For updates is it expected that I first fetch the existing values, then submit an update with basically all fields filled? Do I need to manage "history" myself as well?
This is a limitation in the current pyscicat. The underlying method in the new backend is a
patch
method that has models for updates that make items optional. We should implement models forUpdateRawDatasetDto
andUpdateDerivedDatasetDto
and use those rather than the model for the dataset itself.The text was updated successfully, but these errors were encountered: