You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes OPC UA DataValue construction compatibility between asyncua versions.
asyncua 1.x uses the StatusCode_ field, while newer versions use StatusCode. The synchronization layer now handles both APIs without changing the configured dependency version.
This fixes OPC UA read and subscription operations failing with:
TypeError: DataValue.init() got an unexpected keyword argument 'StatusCode_'
Changes
Added a compatibility helper for ua.DataValue.
Supports both StatusCode and StatusCode_.
Updated read callbacks and subscription push DataValue creation.
The issue was detected while testing the OPC UA functionality of OpenPLC Runtime in an Ubuntu Linux virtual machine.
During the test, OPC UA read and subscription operations failed with the following error:
TypeError: DataValue.__init__() got an unexpected keyword argument 'StatusCode_'
We reproduced the issue in the Ubuntu environment and traced it to the asyncuaDataValue API. The installed asyncua version expects StatusCode, while the synchronization layer was constructing DataValue using StatusCode_.
This led us to implement a compatibility helper that supports both StatusCode and StatusCode_, allowing the OPC UA synchronization layer to work with both asyncua API variants without changing the project's configured dependency version.
The fix was then tested against the affected OPC UA read and subscription paths.
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
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.
Description
Fixes OPC UA DataValue construction compatibility between asyncua versions.
asyncua 1.x uses the
StatusCode_field, while newer versions useStatusCode. The synchronization layer now handles both APIs without changing the configured dependency version.This fixes OPC UA read and subscription operations failing with:
TypeError: DataValue.init() got an unexpected keyword argument 'StatusCode_'
Changes
ua.DataValue.StatusCodeandStatusCode_.Target branch: development