tidyverse / duckplyr

A drop-in replacement for dplyr, powered by DuckDB for performance.
https://duckplyr.tidyverse.org/
Other
280 stars 18 forks source link

Easier way to enable fallback reporting? #216

Open hadley opened 3 months ago

hadley commented 3 months ago

It would be nice to be able to do something like duckdb::fallback_reporting(TRUE). I think that could write a file to tools::R_user_dir("duckplyr", "cache")/DUCKPLYR_FALLBACK_LOG_DIR that has lower precedence than the environment variables.

I think requiring the user to edit their ~/.Renviron is too big of a barrier to data collection, and it would be nice to reduce:

The duckplyr package is configured to fall back to dplyr when it encounters an incompatibility. Fallback events can be collected and
uploaded for analysis to guide future development. By default, no data will be collected or uploaded.
ℹ Fallback logging is not controlled and therefore disabled. Enable it with [Sys.setenv(DUCKPLYR_FALLBACK_COLLECT = 1)](vscode-file://vscode-app/Applications/Positron.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#), disable it with
  [Sys.setenv(DUCKPLYR_FALLBACK_COLLECT = 0)](vscode-file://vscode-app/Applications/Positron.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#).
ℹ Fallback uploading is not controlled and therefore disabled. Enable it with [Sys.setenv(DUCKPLYR_FALLBACK_AUTOUPLOAD = 1)](vscode-file://vscode-app/Applications/Positron.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#), disable it
  with [Sys.setenv(DUCKPLYR_FALLBACK_AUTOUPLOAD = 0)](vscode-file://vscode-app/Applications/Positron.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#).
ℹ See [duckplyr::fallback](vscode-file://vscode-app/Applications/Positron.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#) for details.

to something like:

duckplyr falls back to dplyr when it encounters an incompatibility. 
We would like to find out about these events so we can make duckplyr better.
i Use `duckdb::fallback_upload()` to upload this report
i Use `duckdb::fallback_reporting(TRUE)` to automatically upload future reports

I'm not sure why we're not logging by default, since that seems like a very low risk activity?

krlmlr commented 3 weeks ago

DoD: