Fix setup command default issue#4172
Merged
MonkeyCanCode merged 2 commits intoapache:mainfrom Apr 14, 2026
Merged
Conversation
Contributor
Author
|
@officialasishkumar thanks for your PR in #4167 and I believed this PR should addressed all of the issues in other classes as well as correct semantic for using @Zevrap-81, this PR should fix the problem which you are facing. |
6 tasks
jbonofre
previously approved these changes
Apr 12, 2026
dimas-b
approved these changes
Apr 13, 2026
flyrain
approved these changes
Apr 13, 2026
Contributor
flyrain
left a comment
There was a problem hiding this comment.
LGTM. Thanks @MonkeyCanCode !
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.
The current
setupcommand was serializing optional fields such asroleArn(reported in #4167) as well asstsEndpoint(reported in #4076). Both of them are due toCommanddataclasses don't support default value which making almost all fields mandatory in the constructor.While I work on the
setupcommand, my assumption was default value such as""are safe to provide and server will handle them (miss on my end).Now to fix this issue, this PR changes all Command dataclasses to use a flexible model by using
Optionaltype hints withNoneas defaults. Then I use__post_init__to ensure mandatory fields are getting update to proper default values if not been implicitly defined. As they are now optional, I then ensure we have proper tests invalidation()to cover all required fields as well as using implicitly type casting to ensure mypy is happy with these changes.Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)