Skip to content

Conversation

@rraulinio
Copy link
Member

@rraulinio rraulinio commented Nov 13, 2025

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:

CSVInputSerialization(file_header_info=FILE_HEADER_INFO_NONE)
# TypeError: __init__() got an unexpected keyword argument 'file_header_info'

Root Cause
# Broken (v7.2.17+):

@dataclass(frozen=True)
class CSVInputSerialization(InputSerialization):
    file_header_info = None 

# Fixed:

@dataclass(frozen=True)
class CSVInputSerialization(InputSerialization):
    file_header_info: Optional[str] = None

# Solution:
Add Optional[str] type annotations to all dataclass fields in:

  • CSVInputSerialization(7 fields)
  • JSONInputSerialization (1 field)
  • CSVOutputSerialization (5 fields)
  • JSONOutputSerialization (1 field)

@rraulinio rraulinio marked this pull request as draft November 13, 2025 09:48
@rraulinio rraulinio self-assigned this Nov 13, 2025
@rraulinio rraulinio requested a review from Copilot November 13, 2025 09:49
Copilot finished reviewing on behalf of rraulinio November 13, 2025 09:52
Copy link

Copilot AI left a 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.

@rraulinio rraulinio marked this pull request as ready for review November 13, 2025 09:57
@rraulinio
Copy link
Member Author

Blocking minio/mint#399.

@harshavardhana harshavardhana merged commit cbac53b into minio:master Nov 13, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants