Open
Conversation
`gmd(version = NA)` previously crashed with the cryptic R-level "missing value where TRUE/FALSE needed" because `NA` propagated into `tolower(version) == "list"`, where the comparison yields `NA` and `if (NA)` is an error. Same error for `version = 2025`, or a multi-element character vector. Reject those inputs up-front with a clear message naming the argument. Internal issue: KMueller-Lab/Global-Macro-Database-Internal#413 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.
Tracked upstream at Global-Macro-Database-Internal#413. Same filter applied to the recent Stata PR: fix actual bugs, skip nice-to-haves.
Bug
gmd(version = NA)crashed with the cryptic R-level error"missing value where TRUE/FALSE needed". Root cause atR/gmd.R:263:With
version = NA,tolower(NA)returnsNA,NA == "list"returnsNA, andif (NA)is an error. Same failure mode forversion = 2025(numeric) or a multi-element character vector.Fix
Reject those inputs at the top of the version-check block with a clear message that names the argument.
Verified
Out of scope
Other issues catalogued in #413 (double "Error:" prefix, case-sensitivity inconsistency across country/variables/sources,
iso=TRUEwarning vs error, empty-vector handling, dependency cleanup,start_year/end_yearnot implemented) are UX/consistency issues rather than functional bugs, kept for separate PRs.Also note: the listed-but-404 versions on S3 (
2025_01/03/05/06/08) are a release-pipeline issue and not fixable here.