Skip to content

chore: drop dplyr from DESCRIPTION, regenerate NAMESPACE/man, final R CMD check verification - #142

Merged
chris-prener merged 3 commits into
mainfrom
134-drop-dplyr-description-final-check
Aug 13, 2026
Merged

chris-prener merged 3 commits into
mainfrom
134-drop-dplyr-description-final-check

Conversation

@chris-prener

@chris-prener chris-prener commented Aug 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Removes dplyr as a direct Import of zippeR, completing ADR-0005's Phase 3/4 and closing out [Epic L] #129. All four conversion sub-issues (#130–#133) landed the R/ call-site rewrites; this PR handles the final cleanup: dropping the dependency declaration, converting the last remaining dplyr:: usage in data-raw/build_uds_crosswalk.R, and fixing a test-file dependency that R CMD check flagged. Also folds in #141, a documentation follow-up (auto-filed by code review) clarifying that explanatory dplyr-referencing comments are intentionally retained and out of scope for the epic's "no dplyr:: reference" acceptance criteria.

Implementation

Per the implementation plan on #134: converted data-raw/build_uds_crosswalk.R's dplyr::filter()/mutate()/arrange()/bind_rows() call sites to Base R (bracket subsetting, order(), and an inline bind_rows_base() helper matching dplyr's union-of-columns contract), removed dplyr (>= 1.0.0) from DESCRIPTION Imports, and regenerated NAMESPACE/man via devtools::document() (no diff — dplyr was never re-exported). During verification, R CMD check surfaced an unstated-dependency WARNING from 18 dplyr::filter()/select() calls in tests/testthat/test_zi_aggregate.R that weren't part of the original scope; these were converted to Base R subsetting as well, since the epic's acceptance criteria require 0 warnings.

Per the implementation plan on #141: added a short clarifying note next to the dplyr-referencing explanatory comment blocks in R/zi_utils.R, R/zi_prep_hud.R, data-raw/build_uds_crosswalk.R, and tests/testthat/test_zi_utils.R, making explicit that these are intentional references documenting Base R-equivalence rationale, not functional dplyr usage. Also corrected #134's own AC checklist wording (previously "zero dplyr references") to match the parent epic's more precise "no dplyr:: reference" phrasing, and checked off all five items with a one-line clarification.

Testing

  • devtools::test() — 323 passed, 0 failed, 32 integration tests skipped (require live Census API key, as expected).
  • devtools::check() — 0 errors, 0 warnings, 1 note (unable to verify current time). Confirmed via a git stash A/B comparison that this note is pre-existing and environment-only (present on main before this change). Before this PR, main had 2 notes (the same time-check note plus Namespace in Imports field not imported from: dplyr); this PR eliminates the dplyr note and the dplyr test-dependency WARNING entirely.
  • grep -rn "dplyr" R/ vignettes/ data-raw/ README.md tests/ confirms zero remaining functional dplyr:: call sites — only explanatory comments documenting Base R equivalence rationale (in R/zi_utils.R, R/zi_prep_hud.R, tests/testthat/test_zi_utils.R) remain, left intentionally.
  • Manually verified data-raw/build_uds_crosswalk.R's Base R conversion logic (NA handling in the ZCTA filter via %in%; bind_rows_base()'s union-of-columns semantics) directly in the R console, since the script requires live network access and has no automated test coverage.
  • Re-ran grep -rn "dplyr::" R/ tests/ vignettes/ data-raw/ README.md and grep -rn "library(dplyr)" ... after [Code review] data-raw/build_uds_crosswalk.R: clarify 'zero dplyr references' AC wording vs. explanatory comments #141's comment edits — confirmed zero functional call sites / imports remain.
  • Re-ran devtools::test() after [Code review] data-raw/build_uds_crosswalk.R: clarify 'zero dplyr references' AC wording vs. explanatory comments #141's comment-only edits — 323 passed, 0 failed (no behavior change). Re-ran devtools::document() — no NAMESPACE/man diff.

Closes

Closes #134
Closes #141

Notes

⚠ UAT required (R/ changes)

Per this repo's Human-in-the-loop rule, any change to R/ scripts requires User Acceptance Testing before merge, including comment-only changes. This PR adds a 4-line clarifying comment block to R/zi_utils.R (top of file) and R/zi_prep_hud.R (inline, before an existing comment at line ~93) — both are comment-only additions, no functional/logic changes, no exported behavior change. devtools::test() (323 passed, 0 failed) and devtools::document() (no NAMESPACE/man diff) confirm no behavioral impact. This PR must not be merged until the repo maintainer has reviewed and confirmed acceptance of these two comment additions.


Co-authored-by: Copilot

chris-prener and others added 2 commits August 13, 2026 11:37
…ase R

Removes dplyr as a direct Import per ADR-0005 Phase 3/4:
- Convert data-raw/build_uds_crosswalk.R's dplyr::filter/mutate/arrange/
  bind_rows call sites to Base R (subsetting, order(), and an inline
  bind_rows_base() helper matching the union-of-columns contract).
- Convert tests/testthat/test_zi_aggregate.R's dplyr::filter/select call
  sites to Base R subsetting, eliminating the R CMD check WARNING for
  an unstated test dependency on dplyr.
- Remove dplyr (>= 1.0.0) from DESCRIPTION Imports.
- Regenerate NAMESPACE/man via devtools::document() (no diff).

R CMD check: 0 errors, 0 warnings, 1 note (pre-existing, environment-only
'unable to verify current time' — present on main prior to this change).

Closes #134.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add explicit 'intentional, out of scope for reference removal' notes
next to the explanatory comment blocks in R/zi_utils.R, R/zi_prep_hud.R,
data-raw/build_uds_crosswalk.R, and tests/testthat/test_zi_utils.R that
document Base R helpers' dplyr-equivalence rationale, resolving the
AC-wording ambiguity flagged by code review during #134.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@chris-prener
chris-prener merged commit 065cc20 into main Aug 13, 2026
10 checks passed
@chris-prener

Copy link
Copy Markdown
Collaborator Author

UAT sign-off

Repo maintainer (@chris-prener) reviewed and accepted the two comment-only additions to R/zi_utils.R and R/zi_prep_hud.R (clarifying-note blocks re: dplyr references, no functional/logic change) per the repo's Human-in-the-loop rule for R/ changes.

Verified via devtools::test() (323 passed, 0 failed) and devtools::document() (no NAMESPACE/man diff).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant