20260616/#413 double check errors in r#8
Open
Yicheng-Zhao1999 wants to merge 2 commits into
Open
Conversation
Yicheng-Zhao1999
force-pushed
the
20260616/#413-double-check-errors-in-R
branch
from
June 29, 2026 15:06
79ff9d0 to
e9e7334
Compare
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.
Summary
Robustness fixes for the R
globalmacrodatapackage, from the cross-language audit in #318. Every change was live-verified with R 4.5.3 against the live S3 backend (download paths, bug repros, and a full regression after each change).Two audit items are intentionally not changed here:
Error:prefix (Update NAMESPACE #3): could not be reproduced; left as-is.Bug fixes
gmd(version = NA)crashed with a crypticmissing value where TRUE/FALSE neededversionis a single non-NA character string (orNULL) at the top ofgmd(), before any downloadgmd(iso = TRUE, country = "USA")only warned, then silently discarded the extra argsstop) on conflicting inputs; the guard also coverssources/citevariableswas case-sensitive whilecountry/sourceswere not (variables = "rgdp"failed)rgdp→rGDP); invalid codes still errorcountry = character(0), …) downloaded the full ~21 MB dataset before failingcountry/variables(and empty/NAcite) up front, before any network requeststart_year/end_yearwere not implemented (unused argument)apply_year_filter()helper applied across the main, raw, and sources paths; validated up frontQuality / robustness improvements (audit item #8)
Depends: R (>= 3.5.0)and version floors (readr (>= 2.0.0),httr2 (>= 1.0.0),haven (>= 2.0.0)); migrated from the superseded httr to httr2 (request/req_perform/resp_body_*, withreq_error()disabled to preserve the non-200 →NULLbehaviour).col_typeson the fixed-schema CSVs (versions, varlist, isomapping, source_list, bib) and the stable id columns of the raw CSV (ISO3/countryname/year); dynamic source columns remain inferred..gmd_safe_getnow logs the HTTP status code (or the error message) on failure, so users can distinguish a 404 from a timeout. Still returnsNULL, so control flow is unchanged.data.frame(previously a mix oftbl_df/spec_tbl_df/data.frame); thevarslist keeps its customgmd_varsprint class.Testing
.dta), each bug's before/after repro, and a 13-point regression re-run after every change.start_year/end_yearyear windows, case-insensitive variable/source names, and the empty-vector/NAguards all behave as expected; existing happy-path calls are unchanged.🤖 Generated with Claude Code