fix: Fix typing in examples and tests - #166
Merged
Merged
Conversation
spanglerco
commented
Oct 22, 2025
spanglerco
marked this pull request as ready for review
October 22, 2025 19:14
rbell517
approved these changes
Oct 22, 2025
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.
What does this Pull Request accomplish?
Make mypy checking more strict for Pydantic models and fix or suppress the resulting errors.
Why should this Pull Request be merged?
I noticed that the DFS create_write_data example gets Pydantic validation errors at run-time because it passes numeric values instead of converting them to strings. This led me to discover that Pydantic's mypy plugin causes typing to be more permissive by default. Configuring it to be more strict resulted in 58 type errors, mostly typos that get normalized to the correct camelCase or using strings when other types were expected.
What testing has been done?
Verified all of the DFS examples work. I ran the Test Monitor steps example and it gets farther than it did before my change, but gets a 400 Bad Request. I intend to open a separate issue for that and an issue in the Asset Management assets example.
I temporarily set
init_forbid_extra = Truein the mypy.ini, which revealed a few other issues. However, the Test Monitor client uses extra fields, so I didn't leave that setting on. I suppose we could leave it on and add# type: ignoreto the places we use extra fields, but I didn't try that.