Document required relationship arg on dplyr joins#248
Conversation
Add contributor guidance that dplyr *_join() calls must specify the relationship argument so unexpected many-to-many matches error out instead of silently duplicating rows. Covers CLAUDE.md, the copilot instructions, and a documenting note in .lintr.R. https://claude.ai/code/session_01GKHL3aov2221tUyUDSW5Jo
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
main advanced to 0.0.0.9058, so bump ahead to keep version-check green. https://claude.ai/code/session_01GKHL3aov2221tUyUDSW5Jo
This comment has been minimized.
This comment has been minimized.
|
Claude finished @d-morrison's task in 2m 7s —— View job Code Review: PR #248 — Document required
|
Summary
Adds contributor guidance that dplyr
*_join()calls must specify therelationshipargument (e.g.relationship = "many-to-one"). Declaringthe expected cardinality documents the join's intent and turns an
unexpected many-to-many match into an error instead of a silent row
explosion. Filtering joins (
semi_join()/anti_join()) are out ofscope — they cannot duplicate rows.
Changes
CLAUDE.md— new bullet under Idiomatic-code review focus so the@claudereview agent flags joins missingrelationship..github/copilot-instructions.md— new code-style bullet alongsidethe existing "prefer dplyr joins over
merge()" guidance..lintr.R— a documenting comment noting the requirement. lintr hasno built-in "missing argument" linter, so this rule is enforced via
review rather than automatically; an enforcing custom linter would
immediately flag existing joins (e.g. in
R/Run_Mod.R,R/reconcile_subject_ids.R,R/sim_case_data.R) and break CI.NEWS.md/DESCRIPTION— dev changelog entry and version bump(
0.0.0.9058→0.0.0.9059, after merging the latestmain).Reference: PR #240.
https://claude.ai/code/session_01GKHL3aov2221tUyUDSW5Jo