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

Argument to handle "unspecified" fields #39

Open
mgirlich opened this issue Oct 27, 2021 · 1 comment
Open

Argument to handle "unspecified" fields #39

mgirlich opened this issue Oct 27, 2021 · 1 comment
Milestone

Comments

@mgirlich
Copy link
Owner

mgirlich commented Oct 27, 2021

Given an object to tibblify and a specification for this there might be some fields that are not specified. Now, this could be because:

  • you don't care about these additional fields
  • an optional field has changed the name or there are new fields
  • some fields simply vary

The specification should help to clarify what's the case (a bit similar to readr::cols() vs. readr::cols_only()). Therefore, the spec should get these arguments:

  • unspecified_fields = c("inform", "warn", "error", "ignore", "collect")
    • "ignore" implies that you know there are (or might be) other fields but you deliberately ignore them
    • "error" implies that you don't expect other fields, e.g. useful when getting data from an API and storing it
    • "inform"/"warn" not sure if both are needed
  • unspecified_fields_to is a string specifying the column name where unspecified fields should end up in (similar to tib_multi() How to handle fields whose specification cannot be guessed? #38).
  • known_fields to specify the keys of other fields you know exist but you decide to ignore

Things to consider

  • a known field is always optional
  • a field can be in known_fields and have a specification
  • allow known_fields to be a list so that they can be used for nested keys as well
@mgirlich mgirlich added this to the 0.3 milestone Jun 29, 2022
@mgirlich mgirlich modified the milestones: 0.3, 0.4 Nov 17, 2022
@mgirlich mgirlich changed the title Argument to handle "unknown" fields Argument to handle "unspecified" fields Dec 23, 2022
@mattwarkentin
Copy link

Is there no way currently to silence the message emitted by tibblify::tibblify() when there are unspecified columns other than wrapping it with suppressMessages()?

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

No branches or pull requests

2 participants