Skip to content

Update get_attributes to handle attributeLists w single attribute#326

Open
ianbrunjes wants to merge 1 commit intoropensci:masterfrom
ianbrunjes:get_attributes_single
Open

Update get_attributes to handle attributeLists w single attribute#326
ianbrunjes wants to merge 1 commit intoropensci:masterfrom
ianbrunjes:get_attributes_single

Conversation

@ianbrunjes
Copy link
Contributor

Under certain conditions (see reprex in #285), passing an attributeList with a single attribute into get_attributes will cause an error due to the use of lapply, which for multiple attributes (represented as a list of lists) will correctly apply the function to each attribute, but for a singular attribute (which can be just a flat list) would attempt to apply the function to each character element of the list and causes the error.

This fix attempts to prevent that error by identifying which case is being handled and applying the appropriate logic accordingly.

With that said, this fix feels a little hacky to me and if anyone has a better idea on how to handle it I very much welcome input.

@ianbrunjes ianbrunjes changed the title Update get_attributes to handle attributeLists w single attribute, #285 Update get_attributes to handle attributeLists w single attribute Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant