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 functions to use linelist style tagging #68

Merged
merged 21 commits into from
Feb 5, 2025
Merged

Conversation

chartgerink
Copy link
Member

@chartgerink chartgerink commented Feb 4, 2025

This PR reverts the naming of tags -> labels back to tags. In the process, there are also changes to revert to consistency with linelist, and help improve drop-in update on that side. This means that the arguments in this PR are consistent with functions in linelist

Commits:

  • Update tags()
  • Redocument etc
  • Update tag_variables()
  • Update drop_safeframe()
  • Update restore_tags() and related
  • Update square_brackets.R and downstream
  • Update make_safeframe()
  • Update print.safeframe()
  • Ensure tags() returns empty list
  • Update set_tags()
  • Update validate_tags()
  • Update validate_*() functions
  • Update type()
  • Update tags_df()
  • Remove names() (default is sufficient now)
  • Update remaining tests
  • Update dplyr vignette
  • Update has_tag() and safeframe-package
  • Regen docs, ensure checks etc run

@chartgerink chartgerink force-pushed the update/tags-fn branch 2 times, most recently from 2de133c to 75f050f Compare February 4, 2025 13:06
R/make_safeframe.R Outdated Show resolved Hide resolved
@chartgerink
Copy link
Member Author

Seems like setdiff has changed since the last release in a way that is altering how the result is returned (see wch/r-source@6dedb30).

Old (r-release):

x <- make_safeframe(cars, mph = 'speed')
tags <- list(mph = "speed", mph = "edad")
setdiff(tags, names(x))

$mph
[1] "speed"

New (r-devel):

x <- make_safeframe(cars, mph = 'speed')
tags <- list(mph = "speed", mph = "edad")
setdiff(tags, names(x))
[[1]]
[1] "edad"

I replaced it with a more consistent implementation for our purposes in b51a9d6

@chartgerink chartgerink changed the title Update functions to tags Update functions to use linelist style tagging Feb 5, 2025
@chartgerink chartgerink merged commit 8ef46cc into main Feb 5, 2025
8 checks passed
@chartgerink chartgerink deleted the update/tags-fn branch February 5, 2025 10:31
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.

2 participants