Skip to content

Refactor/perf batch 2#661

Open
timcadman wants to merge 45 commits into
v7.0-devfrom
refactor/perf-batch-2
Open

Refactor/perf batch 2#661
timcadman wants to merge 45 commits into
v7.0-devfrom
refactor/perf-batch-2

Conversation

@timcadman
Copy link
Copy Markdown
Contributor

@timcadman timcadman commented Apr 13, 2026

Summary of changes:

Client function refactoring

22 client functions refactored (ds.abs, ds.asCharacter, ds.asDataMatrix, ds.asInteger, ds.asList, ds.asLogical, ds.asMatrix, ds.asNumeric, ds.class, ds.colnames, ds.completeCases, ds.dim, ds.exp, ds.isNA, ds.length, ds.levels, ds.log, ds.ls, ds.names, ds.numNA, ds.sqrt, ds.unique):

  • Replaced datasource check and defaults boilerplate with .set_datasources()
  • Removed clientside validation of existence and class — validation now handled server-side by.loadServersideObject() and .checkClass()
  • Removed MODULE 5 object-creation checks (isAssigned, messageDS, is.object.created/validity.check returns)
  • Functions that call dimDS, lengthDS, numNaDS, isNaDS now unwrap list returns ($dim, $length, $numNA, $is.na)

New shared utilities in R/utils.R: .set_datasources(), .verify_datasources(), .checkClassConsistency(),
.check_df_name_provided()

Downstream fixes

13 additional client functions updated because they call refactored server functions: glmChecks, ds.summary, ds.quantileMean, ds.recodeLevels, ds.replaceNA, ds.rowColCalc, ds.subsetByClass, ds.dataFrameFill, meanByClassHelper0b, meanByClassHelper2, meanByClassHelper3, subsetHelper, checkClass. Key changes:

  • as.symbol(paste0("functionDS(...)"))call("functionDS", ...) where server functions now expect string names
  • Unwrap new list return formats from dimDS, lengthDS, numNaDS
  • Handle .loadServersideObject() erroring on missing columns (previously returned NULL silently)

Test updates

  • Wrong-class checks moved from arg to smk tests (now server-side errors)
  • $ValidityMessage expectations removed (levelsDS no longer returns it)
  • DISCORDANT tests updated for server-side column-not-found errors
  • Performance tests added for refactored functions

@timcadman timcadman changed the base branch from master to v7.0-dev April 13, 2026 07:58
@timcadman timcadman marked this pull request as ready for review April 14, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants