Skip to content

Deprecate threads argument across dig_* functions - #53

Merged
beerda merged 5 commits into
develfrom
copilot/deprecate-threads-argument
Sep 7, 2026
Merged

Deprecate threads argument across dig_* functions#53
beerda merged 5 commits into
develfrom
copilot/deprecate-threads-argument

Conversation

Copilot AI commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

This PR aligns threads handling with the existing lifecycle-based deprecation pattern used for deprecated arguments in dig_associations(). The threads argument is now consistently deprecated across all dig_* APIs that expose it.

  • API deprecation alignment

    • Updated these exported functions to use threads = deprecated():
      • dig_associations()
      • dig_grid()
      • dig_correlations()
      • dig_baseline_contrasts()
      • dig_complement_contrasts()
      • dig_paired_baseline_contrasts()
      • dig_tautologies()
  • Lifecycle warning behavior

    • Added lifecycle::is_present(threads) checks with deprecate_warn(...) in each affected function.
    • Kept backward-compatible behavior by defaulting to threads <- 1L when threads is omitted in core call paths.
  • Nested call de-duplication

    • Internal forwarding paths now pass a deprecate_threads = FALSE flag in error_context where needed to avoid repeated warnings when one deprecated public API calls another.
  • Documentation updates

    • Updated @param threads roxygen text in all affected files to explicitly mark the argument as deprecated.
dig_correlations <- function(..., threads = deprecated()) {
    if (lifecycle::is_present(threads)) {
        deprecate_warn(
            when = "2.2.0",
            what = "nuggets::dig_correlations(threads)",
            details = "The `threads` argument is deprecated and will be removed in future versions."
        )
    }
    ...
}

Co-authored-by: beerda <26056018+beerda@users.noreply.github.com>
@beerda

beerda commented Sep 7, 2026

Copy link
Copy Markdown
Owner

@copilot change the "when" version to "2.3.0"

Co-authored-by: beerda <26056018+beerda@users.noreply.github.com>

Copilot AI commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot change the "when" version to "2.3.0"

Updated to when = "2.3.0" in the affected deprecation warnings. Fixed in commit 548a2b6.

Copilot AI requested a review from beerda September 7, 2026 10:58
@beerda

beerda commented Sep 7, 2026

Copy link
Copy Markdown
Owner

@copilot you have wrongly updated the "when" value also in other cases than just for threads argument. Fix it = revert the "when" value for occurences other than for "threads". Also put the deprecation test of "threads" argument just before ".must_be...." test of threads.

@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 46.34146% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.13%. Comparing base (a2b5a85) to head (ced07ae).

Files with missing lines Patch % Lines
R/dig_associations.R 50.00% 4 Missing ⚠️
R/dig_baseline_contrasts.R 40.00% 3 Missing ⚠️
R/dig_complement_contrasts.R 40.00% 3 Missing ⚠️
R/dig_correlations.R 40.00% 3 Missing ⚠️
R/dig_grid.R 57.14% 3 Missing ⚠️
R/dig_paired_baseline_contrasts.R 40.00% 3 Missing ⚠️
R/dig_tautologies.R 50.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel      #53      +/-   ##
==========================================
+ Coverage   87.09%   87.13%   +0.04%     
==========================================
  Files         127      127              
  Lines        6469     6508      +39     
==========================================
+ Hits         5634     5671      +37     
- Misses        835      837       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: beerda <26056018+beerda@users.noreply.github.com>

Copilot AI commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot you have wrongly updated the "when" value also in other cases than just for threads argument. Fix it = revert the "when" value for occurences other than for "threads". Also put the deprecatio...

Fixed. I reverted when back to "2.2.0" for non-threads deprecations and moved threads deprecation checks to just before the downstream threads validation path. Commit: 3523350.

@beerda

beerda commented Sep 7, 2026

Copy link
Copy Markdown
Owner

@copilot deprecate "threads" also in "dig()" function in R/dig.R

Co-authored-by: beerda <26056018+beerda@users.noreply.github.com>

Copilot AI commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot deprecate "threads" also in "dig()" function in R/dig.R

Implemented in dig() in /home/runner/work/nuggets/nuggets/R/dig.R with lifecycle deprecation warning and omitted-value fallback. Also suppressed duplicate nested warning in dig_grid() forwarding. Commit: 0ff93b6.

@beerda

beerda commented Sep 7, 2026

Copy link
Copy Markdown
Owner

@copilot fix duplicate nested warning also in other dig* functions after you have introduced that warning in dig()

Copilot AI commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix duplicate nested warning also in other dig* functions after you have introduced that warning in dig()

Checked and aligned all nested dig* call chains for threads deprecation suppression: callers forward deprecate_threads = FALSE to avoid duplicate warnings (dig_tautologies -> dig_associations, dig_correlations/dig_*_contrasts -> dig_grid, and dig_grid -> dig). The dig_grid -> dig part was added in commit 0ff93b6; wrapper suppressions are already in place.

@beerda
beerda marked this pull request as ready for review September 7, 2026 11:23
@beerda
beerda merged commit e7acebd into devel Sep 7, 2026
1 check passed
@beerda
beerda deleted the copilot/deprecate-threads-argument branch September 7, 2026 11:23
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.

2 participants