-
Notifications
You must be signed in to change notification settings - Fork 354
Fix: Add missing type annotations to serialization dataclass fields #1527
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
Conversation
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.
Pull Request Overview
This PR fixes a critical bug introduced in v7.2.17 where serialization dataclass fields were missing type annotations, preventing them from being used as __init__ parameters and causing TypeError when instantiating these classes with arguments.
- Added
Optional[str]type annotations to 14 dataclass fields across 4 serialization classes - Enables proper instantiation of serialization classes with keyword arguments (e.g.,
CSVInputSerialization(file_header_info=FILE_HEADER_INFO_NONE)) - No functional changes to existing logic or validation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Blocking minio/mint#399. |
Relates to: minio/mint#399.
Problem
PR #1504 (v7.2.17) converted serialization classes to dataclasses but did not add type annotations to fields. Without type annotations, they don't become
__init__parameters.Error:
Root Cause
# Broken (v7.2.17+):
# Fixed:
# Solution:
Add
Optional[str]type annotations to all dataclass fields in:CSVInputSerialization(7 fields)JSONInputSerialization(1 field)CSVOutputSerialization(5 fields)JSONOutputSerialization(1 field)