Skip to content

Hot fix mypy on dataclass#189

Merged
heevasti merged 3 commits intomainfrom
hot-fix-mypy-on-dataclass
Apr 1, 2026
Merged

Hot fix mypy on dataclass#189
heevasti merged 3 commits intomainfrom
hot-fix-mypy-on-dataclass

Conversation

@heevasti
Copy link
Copy Markdown
Collaborator

@heevasti heevasti commented Apr 1, 2026

The latest Mypy version does not accept direct access to dataclass object values if they are not instantiated. Therefore, some issues were raised in three instrument drivers where this way of implementation was used. These implementations were now changed such that the dataclasses are now with default values for the problematic cases and they are instantiated with these default values.

The unit-tests, which were testing the initial state of these dataclasses, were also adjusted to test the new default values. Other unit-tests which then make use of the dataclasses with non-default values, pass. The unit tests should be already defined such that these dataclasses are set during the tests, not patched to let any value pass.

@heevasti heevasti requested a review from pieterjbotma April 1, 2026 10:08
@heevasti heevasti merged commit 8997cf5 into main Apr 1, 2026
6 checks passed
@heevasti heevasti deleted the hot-fix-mypy-on-dataclass branch April 1, 2026 10:12
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.

2 participants