Repository navigation
doi_to_product_name: return Unknown DOI fallback on unknown DOI - #4278
Open
madhavzanwar wants to merge 4 commits into
Open
madhavzanwar wants to merge 4 commits into
madhavzanwar wants to merge 4 commits into
Conversation
return 0 for an unknown DOI instead of erroring Fixes #doi_map[[doi]] errors for a missing name so the Unknown DOI fallback never ran. Use unname(doi_map[doi]) and is.na().:4254
madhavzanwar
marked this pull request as ready for review
November 27, 2026 16:39
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.
Fixes #4254
What
In
modules/data.remote/R/NASA_DAAC_download.R,doi_to_product_name()looked up DOIs usingdoi_map[[doi]]. When given an unknown DOI,[[threw"subscript out of bounds", which aborted execution before reaching theis.null(product_name)check that logs"Unknown DOI"and returns0.The lookup now uses
product_name <- unname(doi_map[doi])withis.na(product_name), gracefully falling back to0and logging"Unknown DOI"as documented.Adds entries to
CHANGELOG.mdandmodules/data.remote/NEWS.md.Testing
Unit tests added in
modules/data.remote/tests/testthat/test-doi_to_product_name.Rcover known DOIs, NULL, and unknown DOIs. The unknown DOI test fails ondevelopand passes with this fix.