-
Notifications
You must be signed in to change notification settings - Fork 52
fix: add acceptedUsageKey and acceptedScientificName to name_backbone… #826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,3 +127,14 @@ test_that("name_backbone verbose=TRUE", { | |
| expect_true(all(vv$verbatim_name == "Calopteryx")) | ||
| expect_true(nrow(vv) > nrow(tt)) | ||
| }) | ||
|
|
||
| test_that("name_backbone returns acceptedUsageKey", { | ||
| vcr::use_cassette("name_backbone_acceptedUsageKey", { | ||
| aa <- name_backbone(name = 'Anastrophyllum minutum') | ||
| }) | ||
| expect_is(aa, "tbl") | ||
| expect_is(aa, "tbl_df") | ||
| expect_is(aa, "data.frame") | ||
| expect_true("acceptedUsageKey" %in% colnames(aa)) | ||
| expect_true("acceptedScientificName" %in% colnames(aa)) | ||
|
Comment on lines
+138
to
+139
|
||
| }) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The acceptedUsage processing subsets only the "key" and "name" fields, which is inconsistent with how the usage object is processed (lines 231-235). The usage processing converts the entire object to a tibble and then renames specific columns. Consider following the same pattern here: convert the entire acceptedUsage object to a tibble first, then rename the columns, to maintain consistency and allow any additional fields from the API to be included.