microsoft / datamations

https://microsoft.github.io/datamations/
Other
66 stars 14 forks source link

Gracefully handle unsupported operations #149

Closed jhofman closed 2 years ago

jhofman commented 2 years ago

Related to #31, let's figure out how to handle unsupported or plot-based no-op verbs like arrange and select

jhofman commented 2 years ago

Right now we throw an error and say that you've used an unsupported function.

Next time let's talk about whether we could support "no-op" verbs in some consistent way.

jhofman commented 2 years ago

@willdebras, can you take a look at this to make sure we're handling this gracefully?

willdebras commented 2 years ago

I have updated this handling to be a bit more graceful. Instead of erroring on all non supported verbs, we just warn and skip on no-ops:

"small_salary %>%
  select(Degree, Salary) %>%
  group_by(Degree) %>%
  arrange(desc(Salary)) %>%
  summarize(mean = mean(Salary))" %>%
  datamation_sanddance()

This pipeline results in console warnings like this:

Warning messages: 1: In .f(.x[[i]], ...) : Pipeline step for select discarded as a non-visualized function. 2: In .f(.x[[i]], ...) : Pipeline step for arrange discarded as a non-visualized function.

@jhofman

  1. Do you have specific language you want here?
  2. Are there other verbs besides arrange or select you can think of that we should just skip instead of erroring on?
jhofman commented 2 years ago

looks good.

let's double check that the pipeline runs as intended (e.g., if the mean(Salary) was a first(Salary) we'd get a different result with and without and arrange).

willdebras commented 2 years ago

Confirmed the pipeline runs as intended with arrange, just doesn't visualize it. @jhofman