{{ message }}
fix(oocana): convert CredentialInput to dataclass#462
Open
leavesster wants to merge 1 commit into
Open
Conversation
The CredentialInput class was a plain class with a simple __init__. Converting to dataclass provides: - Automatic __repr__ and __eq__ methods - Consistent with other data classes in the codebase - frozen=True makes it immutable for safety - Added docstring and __all__ export
Contributor
There was a problem hiding this comment.
Pull request overview
Converts CredentialInput into an immutable (frozen) dataclass and makes it an explicit public export.
Changes:
- Replaced the manual
CredentialInputclass with a@dataclass(frozen=True)version. - Added module-level
__all__export forCredentialInput. - Added a class docstring describing purpose and attributes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
All other dataclasses in this package are declared with kw_only=True (e.g., oocana/oocana/handle.py:7, oocana/oocana/data.py:41, oocana/oocana/schema.py:38). To keep CredentialInput consistent and avoid accidental positional-argument usage, consider adding kw_only=True here as well.
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.

Summary
CredentialInputclass to a frozen dataclass__all__exportsProblem
CredentialInputwas a plain class without standard data structure features:__eq__,__hash__,__repr____all__Solution
Test Plan