74: add entity_list create and add_property#87
Merged
lindsay-stevens merged 6 commits intogetodk:masterfrom Jun 3, 2024
Merged
74: add entity_list create and add_property#87lindsay-stevens merged 6 commits intogetodk:masterfrom
lindsay-stevens merged 6 commits intogetodk:masterfrom
Conversation
- probably fair to assume that someone using these examples has the current pyodk release installed. Otherwise, as the number of example scripts grows it would become a bit of a chore to update them all, especially if the target release version isn't yet known.
- the changed lines were written before the validate_str wrapper was added.
- in the last deps update, pydantic changed errors using ValidationError as a base to use PydanticTypeError or PydanticValueError. - added tests to catch this sort of thing in future - added optional "key" param to validate_file_path so that all funcs have more consistent signatures
- makes it easier to do a "create if not exists" / EAFP instead of LBYL.
lognaturel
approved these changes
May 31, 2024
Member
lognaturel
left a comment
There was a problem hiding this comment.
Couple of small comment issues but functionality and misc improvements look great, thank you!
docs/examples/create_entities_from_submissions/create_entities_from_submissions.py
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #74
What has been done to verify that this works as intended?
Added tests with example script.
Why is this the best possible solution? Were any other approaches considered?
Added
getmethod as well because I think that would be useful and it was straightforward.I spent a while on the example script trying to come up with a complete workflow of like: create form -> load submissions -> create entity list -> create entities etc., but I wasn't sure it was realistic or useful so I stuck with what Yaw suggested.
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 features!
Do we need any specific form for testing your changes? If so, please attach one.
Non
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No just the auto-generated docs on release.
Before submitting this PR, please make sure you have:
testspython -m unittestand verified all tests passruff format pyodk testsandruff check pyodk teststo lint code