Skip to content

Conversation

@kaapstorm
Copy link
Contributor

@kaapstorm kaapstorm commented Oct 15, 2025

Technical Summary

  • Adds configuration and a GitHub Action for checking type hints with mypy.
  • Adds type hints for confusing parameters of submit_case_blocks() and submit_form_locally().
  • Adds missing parameters to, and cleans up, a couple of docstrings.
  • Resolves problems identified by mypy.

🐡 🐠 🐟

Safety Assurance

Safety story

No changes to functionality

Automated test coverage

Not applicable

QA Plan

Not applicable

Rollback instructions

  • This PR can be reverted after deploy with no further considerations

Labels & Review

  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@kaapstorm kaapstorm added the product/invisible Change has no end-user visible impact label Oct 15, 2025
@dimagimon dimagimon added dependencies Pull requests that update a dependency file Risk: High Change affects files that have been flagged as high risk. labels Oct 15, 2025
@kaapstorm kaapstorm force-pushed the nh/mypy_2 branch 2 times, most recently from 85c00b5 to af797dd Compare October 15, 2025 23:36
@dimagi dimagi deleted a comment from sentry bot Oct 15, 2025
@kaapstorm kaapstorm marked this pull request as ready for review October 15, 2025 23:37
@kaapstorm
Copy link
Contributor Author

@mjriley this is the type checking GitHub Action I mentioned, and a branch I find helpful for navigating unclear parameters.

Adds type hints for `bulk_update_cases()` parameters so that nobody needs to
get them wrong again, and adds type hint for `submit_case_blocks()` return
values so that the next person doesn't have to spend half an hour looking
them up again.


def bulk_update_cases(domain, case_changes, device_id, xmlns=None):
type CaseID = str
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The type statement declares an alias, for simplifying types and giving them self-explanatory names. (Python 3.12+)

Copy link
Contributor

@biyeun biyeun left a comment

Choose a reason for hiding this comment

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

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file product/invisible Change has no end-user visible impact Risk: High Change affects files that have been flagged as high risk.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants