Skip to content

74: add entity_list create and add_property#87

Merged
lindsay-stevens merged 6 commits intogetodk:masterfrom
lindsay-stevens:pyodk-74
Jun 3, 2024
Merged

74: add entity_list create and add_property#87
lindsay-stevens merged 6 commits intogetodk:masterfrom
lindsay-stevens:pyodk-74

Conversation

@lindsay-stevens
Copy link
Copy Markdown
Contributor

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 get method 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:

  • included test cases for core behavior and edge cases in tests
  • run python -m unittest and verified all tests pass
  • run ruff format pyodk tests and ruff check pyodk tests to lint code
  • verified that any code or assets from external sources are properly credited in comments

- 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.
Copy link
Copy Markdown
Member

@lognaturel lognaturel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of small comment issues but functionality and misc improvements look great, thank you!

@lindsay-stevens lindsay-stevens merged commit fc58f7b into getodk:master Jun 3, 2024
@lindsay-stevens lindsay-stevens deleted the pyodk-74 branch June 3, 2024 17:16
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

Successfully merging this pull request may close these issues.

Add entity_list create and add_property

2 participants