fix: read mapping, filters, ratio_table, and units from YAML in get_settings_code()#1226
Open
fix: read mapping, filters, ratio_table, and units from YAML in get_settings_code()#1226
Conversation
… in get_settings_code() get_settings_code() used a hardcoded default_mapping parameter and ignored filters, ratio_table, units_table, and extra_vars_to_keep stored in the settings YAML. The generated R scripts would use wrong mapping and skip filters, ratios, and unit overrides. Now all fields are read from the YAML when present, with .default_mapping as fallback for legacy files. extra_vars_to_keep is derived from the mapping's Grouping_Variables. The mapping parameter has been removed from the public API. Closes #1189 Co-authored-by: Ona <no-reply@ona.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Closes #1189
Description
get_settings_code()used a hardcodeddefault_mappingparameter and ignoredfilters,ratio_table,units_table, andextra_vars_to_keepstored in the settings YAML. Generated R scripts would use wrong mapping and skip filters, ratios, and unit overrides.Changes:
mapping,filters,ratio_table,units_tablefrom the YAML when presentextra_vars_to_keepfrommapping$select_Grouping_Variables(consistent with the UI path innca_results.R)time_duplicate_keysfrom the YAML instead of hardcodingNULLdefault_mappingto.default_mapping(internal, not exported) and use it as fallback for legacy YAML filesmappingparameter from the public APIDefinition of Done
get_settings_code()reads mapping from YAML, falls back to.default_mappingfor legacy filesget_settings_code()includesapplied_filtersfrom YAML in the session objectget_settings_code()includesratio_tablefrom YAML in the session objectget_settings_code()includesunits_tablefrom YAML in the session objectget_settings_code()derivesextra_vars_to_keepfrom mappingHow to test
get_settings_code(settings_file_path, data_path)— nomappingargument neededmappingkey) — should fall back to CDISC defaultsContributor checklist
.scsschange was done, rundata-raw/compile_css.RNotes to reviewer
get_settings_code(mapping = ...)explicitly. Themappingparameter has been removed since the YAML already contains the mapping (since Enhancement: Add mapping used during session to settings #721). Legacy YAML files without amappingkey still work via.default_mappingfallback.get_settings_code()side; the script template side (Enhancement: Derive extra_vars_to_keep consistently from mapping across UI, R script, and get_settings_code() #1187) and units format (Bug: units_table path mismatch between settings YAML export and R script template #1188) may need separate follow-ups.