-
Notifications
You must be signed in to change notification settings - Fork 680
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
stripping metadata from dataclass types (#626) #6177
stripping metadata from dataclass types (#626) #6177
Conversation
* stripping metadata from dataclass types Signed-off-by: Daniel Rammer <[email protected]> * actually setting on Structure Signed-off-by: Daniel Rammer <[email protected]> * added unit test Signed-off-by: Daniel Rammer <[email protected]> --------- Signed-off-by: Daniel Rammer <[email protected]>
Code Review Agent Run #59e151Actionable Suggestions - 1
Review Details
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6177 +/- ##
=======================================
Coverage 37.05% 37.06%
=======================================
Files 1318 1318
Lines 132638 132644 +6
=======================================
+ Hits 49151 49163 +12
+ Misses 79237 79231 -6
Partials 4250 4250
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Changelist by BitoThis pull request implements the following key changes.
|
Structure: &core.TypeStructure{ | ||
DataclassType: map[string]*core.LiteralType{ | ||
"foo": { | ||
Type: &core.LiteralType_Simple{ | ||
Simple: core.SimpleType_STRING, | ||
}, | ||
}, | ||
}, | ||
Tag: "str", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider simplifying the nested structure by using a more concise initialization pattern for TypeStructure
. The current nested structure with multiple levels of indentation could be made more readable. A similar issue was also found in flytepropeller/pkg/compiler/transformers/k8s/utils_test.go (line 227-245).
Code suggestion
Check the AI-generated fix before applying
// Add helper function
func createTypeStructure(key string, simpleType core.SimpleType, tag string) *core.TypeStructure {
return &core.TypeStructure{
DataclassType: map[string]*core.LiteralType{
key: {
Type: &core.LiteralType_Simple{Simple: simpleType},
},
},
Tag: tag,
}
}
// Use helper function in test
Structure: createTypeStructure("foo", core.SimpleType_STRING, "str"),
Code Review Run #59e151
Is this a valid issue, or was it incorrectly flagged by the Agent?
- it was incorrectly flagged
Signed-off-by: Daniel Rammer <[email protected]>
Code Review Agent Run #03ee88Actionable Suggestions - 0Additional Suggestions - 1
Review Details
|
Tracking issue
N/A
Why are the changes needed?
Metadata is stripped from all other places in the interface(s). It is unnecessary for type checking and only attributes to bloating the CRD.
What changes were proposed in this pull request?
Stripping metadata from dataclass types.
How was this patch tested?
Tested under a variety of workflows and
Labels
Setup process
N/A
Screenshots
N/A
Check all the applicable boxes
Related PRs
N/A
Docs link
N/A
Summary by Bito
Implementation of metadata stripping functionality for dataclass types in Flyte compiler, modifying StripTypeMetadata function to handle dataclass types and replacing direct struct field access with getter methods. The changes focus on removing unnecessary metadata and reducing CRD bloat while maintaining type safety, with updates to test coverage to verify the functionality.Unit tests added: True
Estimated effort to review (1-5, lower is better): 1