-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optional/Nullable support to Python Cluster Objects (#11515)
* Optional/Nullable support to Python Cluster Objects This amongst other things, adds support for optional and nullable types to the Python cluster objects. It does so by leveraging typing.Union and typing.Optional to do so. To represent nulls, a new Nullable type has been created to encapsulate that. Consequently, 'None' indicates an optional field that is not present. 'NullValue' indicates a null-value. Consequently, the following representations map to the various combinations: typing.Union[base-type, Types.Nullable] => a nullable base-type. typing.Optional[base-type] => an optional base-type typing.Union[base-type, Types.Nullable, None] => an optional, nullable, base-type. In addition, the generation helpers for Python have been cleaned up to better align with how it's done for the other languages. Finally, a unit-test for the generated objects has been added which was crucial to fix some critical bugs in the implementation. Tests: - Validated using test_generated_clusterobjects.py. - Validated by sending commands to the test cluster to a device. * Review feedback * Fixes the equality comparison in Python for Nones * Re-gen cluster objects * Adding debug mode to the newly added unit test
- Loading branch information
1 parent
6a8b560
commit 7d613d7
Showing
11 changed files
with
1,336 additions
and
1,109 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.