Skip to content
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

Update get_attributes to handle attributeLists w single attribute #326

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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