Add dataset-level attribute comparison support (#148) - #151
Conversation
|
Hey @botsp , Thanks for this looks good, only remark from me would be could we just have a print test for more complex attributes to make sure it doesn't break the print method. I mean the code is basically the same construct as what is already used so I suspect its fine but would be good to just assert so with a test. |
|
hi @gowerc Thanks for the review. Yes -- for #148 I intentionally followed the existing code structure used in the package. And thanks for the kind reminder, I also added print regression tests for dataframe-level attributes (including complex nested attributes, NULL vs non-NULL, character vector attributes, and a Japanese dataset label case) to confirm the print path remains stable. |
Summary
This PR implements #148 by adding dataset-level attribute comparison in
diffdf(), so differences such as datasetlabel(e.g., DM = "Demographics") can be detected and reported.Closes #148.
What changed
R/identify.R:identify_df_att_differences(BASE, COMP, exclude_attrs = c("names", "row.names", "class"))R/diffdf.R:DataframeAttribDiffsBASE and COMPARE dataframes have differing attributes !!tests/testthat/test-core.R:labeldifferences trigger warnings.DataframeAttribDiffshas expected row count.Validation
Unit test (local source)
testthat::test_local('.', filter = 'core')Real XPT checks (3 scenarios)
Using SDTM XPT examples, validated:
No issues were found!DataframeAttribDiffsreportslabeldifference.Notes
AttribDiffs) behavior is preserved.