Skip to content

Conversation

gerrycampion
Copy link
Collaborator

@gerrycampion gerrycampion commented Oct 10, 2025

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 and SEQ) across the codebase, updates error handling to use the new dataclass-based entities, and adjusts related logic and tests accordingly.

Model Refactoring and Standardization:

  • Converted core validation models (BaseValidationEntity, ValidationErrorEntity, FailedValidationEntity, ValidationErrorContainer, RuleValidationResult, and VariableMetadataContainer) to use Python's @dataclass for clearer structure and automatic field management. [1] [2] [3] [4] [5] [6]
  • Standardized error field names to uppercase (USUBJID, SEQ) throughout the models and related logic, replacing previous inconsistent naming like uSubjId and seq. [1] [2] [3] [4] [5] [6]

Error Handling Improvements:

  • Updated error creation and handling in the rules engine to use the new FailedValidationEntity dataclass instead of overloading ValidationErrorContainer for error cases, making error semantics clearer. [1] [2] [3] [4]
  • Adjusted the logic for generating and representing validation errors to align with the dataclass fields and new naming conventions. [1] [2]

Testing Adjustments:

  • Updated unit tests to reflect the new field names and dataclass-based error object structures.

These changes collectively modernize the validation model code, reduce boilerplate, and improve consistency in error reporting and handling across the codebase.

Copilot AI and others added 20 commits October 3, 2025 20:07
…e to_representation with as_dict

Co-authored-by: gerrycampion <[email protected]>
…field init=False, rename underscore fields

Co-authored-by: gerrycampion <[email protected]>
…onstructor calls to use direct field assignments

Co-authored-by: gerrycampion <[email protected]>
Copy link
Collaborator

@RamilCDISC RamilCDISC left a 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:

  1. Reviewing the code for updated logic.
  2. Validating the PR for any unwanted code or comments.
  3. Ensuring that all related testing has been updated and if new testing is required is added.
  4. Validating that all unit tests and test suite pass.
  5. Running validation on dev editor with this branch deployed to rule tester for SDTMIG datasets.
  6. Running validation on dev editor with this branch deployed to rule tester for SENDIG datasets.
  7. Running validation on dev editor with this branch deployed to rule tester for USDM datasets.
  8. Running validation on dev editor with this branch deployed to rule tester for TIG datasets.

@RamilCDISC RamilCDISC merged commit 4a14fc2 into main Oct 13, 2025
13 checks passed
@RamilCDISC RamilCDISC deleted the copilot/fix-c159e58c-2cca-468b-a348-951b2a07e93a branch October 13, 2025 19:32
@DmitryMK DmitryMK mentioned this pull request Oct 14, 2025
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.

Convert all RepresentationInterface classes to dataclasses

3 participants