-
Notifications
You must be signed in to change notification settings - Fork 17
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
73: add client.entities.update #84
Conversation
- add: entity fields that were not included earlier: - entity.conflict - entity.currentVersion.createdAt - entity.currentVersion.data (None for entities.list()) - chg: use plain uuid4() instead of uuid:uuid4() to match Central
Yes, absolutely, thanks! I think the parameter order should be
It's a relatively minor thing but I do think the parameter order can help with comprehension. In general, if a method updates a resource, I would expect that resource's identifier (the entity uuid) to come first. Similarly, I think it's helpful to have parameters that identify where in the hierarchy the resource is ( I also updated the types -- it's possible and reasonable to only update one of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As described above
- chg: label or data (or both/neither) are allowed for entities.update - add: readme section on default identifiers
Thanks! I updated the params to be optional. There might be some reason to send empty entity updates now or in future (e.g. to update the version only?) so I didn't include an error for them being both blank. Also added a readme note about identifiers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 🎉
Closes #73
What has been done to verify that this works as intended?
New unit and integration tests.
Why is this the best possible solution? Were any other approaches considered?
Added function is as specified in #73. One minor assumption: an error is raised if both
force
andbase_version
are provided. It seemed like that might be dangerous as well, e.g. user specifies the wrong base_version but gets an update anyway.How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
New convenience method.
Do we need any specific form for testing your changes? If so, please attach one.
N/A
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No
Before submitting this PR, please make sure you have:
tests
python -m unittest
and verified all tests passruff format pyodk tests
andruff check pyodk tests
to lint code