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

Reorganize datastore inheritance #2055

Merged
merged 2 commits into from
Feb 24, 2024
Merged

Reorganize datastore inheritance #2055

merged 2 commits into from
Feb 24, 2024

Conversation

alexrudd2
Copy link
Collaborator

@alexrudd2 alexrudd2 commented Feb 24, 2024

This solves 8 more mypy errors, including a real problem in ModbusSparseDataBlock.

The method default() (inherited from ModbusBaseDataBlock) does not make any sense for a sparse datastore, where self.values is a dictionary. If called, it will break the implementation.
==> Move it to ModbusSequentialDataBlock.

Also, reset() is defined in ModbusBaseDataBlock but overridden by ModbusSparseDataBlock.
==> Move it also to ModbusSequentialDataBlock.

Copy link
Collaborator

@janiversen janiversen left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

However it scares me a bit, that no tests were affected .... we really need a lot more testing.

@janiversen janiversen merged commit bf59f3c into dev Feb 24, 2024
1 check passed
@janiversen janiversen deleted the datastore branch February 24, 2024 17:27
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants