-
Notifications
You must be signed in to change notification settings - Fork 24
Converted representation interface classes to dataclasses #1376
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
Merged
RamilCDISC
merged 20 commits into
main
from
copilot/fix-c159e58c-2cca-468b-a348-951b2a07e93a
Oct 13, 2025
Merged
Converted representation interface classes to dataclasses #1376
RamilCDISC
merged 20 commits into
main
from
copilot/fix-c159e58c-2cca-468b-a348-951b2a07e93a
Oct 13, 2025
Conversation
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
…e to_representation with as_dict Co-authored-by: gerrycampion <[email protected]>
…field init=False, rename underscore fields Co-authored-by: gerrycampion <[email protected]>
Co-authored-by: gerrycampion <[email protected]>
…onstructor calls to use direct field assignments Co-authored-by: gerrycampion <[email protected]>
…eValidationResult Co-authored-by: gerrycampion <[email protected]>
…e assignment Co-authored-by: gerrycampion <[email protected]>
…nStatus safety checks Co-authored-by: gerrycampion <[email protected]>
…larations Co-authored-by: gerrycampion <[email protected]>
…ypy failures Co-authored-by: gerrycampion <[email protected]>
…o_representation() Co-authored-by: gerrycampion <[email protected]>
…tps://github.com/cdisc-org/cdisc-rules-engine into copilot/fix-c159e58c-2cca-468b-a348-951b2a07e93a
RamilCDISC
approved these changes
Oct 13, 2025
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.
The PR converts representation interface classes to dataclasses. The PR was validated by:
- Reviewing the code for updated logic.
- Validating the PR for any unwanted code or comments.
- Ensuring that all related testing has been updated and if new testing is required is added.
- Validating that all unit tests and test suite pass.
- Running validation on dev editor with this branch deployed to rule tester for SDTMIG datasets.
- Running validation on dev editor with this branch deployed to rule tester for SENDIG datasets.
- Running validation on dev editor with this branch deployed to rule tester for USDM datasets.
- Running validation on dev editor with this branch deployed to rule tester for TIG datasets.
Merged
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.
This pull request refactors several validation-related models to use Python dataclasses for improved readability, maintainability, and type safety. It also standardizes field names (such as
USUBJID
andSEQ
) across the codebase, updates error handling to use the new dataclass-based entities, and adjusts related logic and tests accordingly.Model Refactoring and Standardization:
BaseValidationEntity
,ValidationErrorEntity
,FailedValidationEntity
,ValidationErrorContainer
,RuleValidationResult
, andVariableMetadataContainer
) to use Python's@dataclass
for clearer structure and automatic field management. [1] [2] [3] [4] [5] [6]USUBJID
,SEQ
) throughout the models and related logic, replacing previous inconsistent naming likeuSubjId
andseq
. [1] [2] [3] [4] [5] [6]Error Handling Improvements:
FailedValidationEntity
dataclass instead of overloadingValidationErrorContainer
for error cases, making error semantics clearer. [1] [2] [3] [4]Testing Adjustments:
These changes collectively modernize the validation model code, reduce boilerplate, and improve consistency in error reporting and handling across the codebase.