Skip to content
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

74: add entity_list create and add_property #87

Merged
merged 6 commits into from
Jun 3, 2024

Conversation

lindsay-stevens
Copy link
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
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!

pyodk/_endpoints/entity_lists.py Outdated Show resolved Hide resolved
tests/endpoints/test_entity_lists.py Outdated Show resolved Hide resolved
@lindsay-stevens lindsay-stevens merged commit fc58f7b into getodk:master Jun 3, 2024
4 checks passed
@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