mgirlich/tibblify

Add helper to quickly resolve ambiguous and unspecified guesses

Opened this issue · 0 comments

In some cases the guessing API might not return what you want:

  • tib_unspecified() because the field is always NULL or absent -> the field could be anything
  • tib_unspecified() because the field is always NULL, absent or an empty list -> the field could be tib_vector(input_form != "vector"), tib_row() or tib_df()
  • tib_df(.names_to = "...") could also be tib_object() (tspec_guess() should prefer tib_df() as it produces the shorter spec)
  • tib_vector(input_form = "object") could also be tib_object() (tspec_guess() should prefer tib_vector() as it produces the shorter spec)

The guess_*() functions should be smarter about this. Add argument unspecified which can be one of:

  • "ask": ask the user immediately what to do
  • "unspecified": keep them as unspecified
  • "known": add them to the known fields

and argument ambiguous

  • "ask": ask the user immediately what to do
  • "inform": choose one and inform