Skip to content

Commit

Permalink
docs: Wrap up documentation on prudence (#559)
Browse files Browse the repository at this point in the history
* docs: Wrap up documentation on prudence

* Link to blog post
  • Loading branch information
krlmlr authored Feb 1, 2025
1 parent 9f5d7ef commit 6e976c5
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion R/ducktbl.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' dplyr verbs such as [mutate()], [select()] or [filter()] will use DuckDB.
#'
#' `duckdb_tibble()` works like [tibble()], returning a lavish duckplyr data frame by default.
#' See `vignette("funnel")` for details.
#' See `vignette("prudence")` for details.
#'
#' @param ... For `duckdb_tibble()`, passed on to [tibble()].
#' For `as_duckdb_tibble()`, passed on to methods.
Expand Down
2 changes: 1 addition & 1 deletion R/io2.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ read_json_duckdb <- function(path, ..., prudence = c("thrifty", "lavish", "fruga
#' `"read_csv"`, `"read_csv_auto"` or `"read_json"`.
#' @param prudence Logical, whether to create a frugal duckplyr frame.
#' By default, a frugal duckplyr frame, with a limit of one million cells, is created.
#' See `vignette("funnel")` for details.
#' See `vignette("prudence")` for details.
#' @param options Arguments to the DuckDB function
#' indicated by `table_function`.
#'
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion R/relational.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ check_prudence <- function(x, duckplyr_error, call = caller_env()) {
"This operation cannot be carried out by DuckDB, and the input is a frugal duckplyr frame.",
"*" = duckplyr_error_msg,
"i" = 'Use {.code compute(prudence = "lavish")} to materialize to temporary storage and continue with {.pkg duckplyr}.',
"i" = 'See {.run vignette("funnel")} for other options.'
"i" = 'See {.run vignette("prudence")} for other options.'
))
}
}
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Of course, working with Parquet, CSV, or JSON files downloaded locally is possib

- `vignette("large")`: Tools for working with large data

- `vignette("funnel")`: How duckplyr can help protect memory when working with large data
- `vignette("prudence")`: How duckplyr can help protect memory when working with large data

- `vignette("limits")`: Translation of dplyr employed by duckplyr, and current limitations

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ locally is possible as well.
- [`vignette("large")`](https://duckplyr.tidyverse.org/dev/articles/large.html):
Tools for working with large data

- [`vignette("funnel")`](https://duckplyr.tidyverse.org/dev/articles/funnel.html):
- [`vignette("prudence")`](https://duckplyr.tidyverse.org/dev/articles/prudence.html):
How duckplyr can help protect memory when working with large data

- [`vignette("limits")`](https://duckplyr.tidyverse.org/dev/articles/limits.html):
Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ articles:
navbar: ~
contents:
- large
- funnel
- prudence
- limits
- developers
- telemetry
Expand Down
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ Of course, working with Parquet, CSV, or JSON files downloaded locally is possib

- `vignette("large")`: Tools for working with large data

- `vignette("funnel")`: How duckplyr can help protect memory when working with large data
- `vignette("prudence")`: How duckplyr can help protect memory when working with large data

- `vignette("limits")`: Translation of dplyr employed by duckplyr, and current limitations

Expand Down
2 changes: 1 addition & 1 deletion man/duckdb_tibble.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/read_file_duckdb.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/read_sql_duckdb.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/_snaps/handle_desc.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Error in `arrange()`:
! This operation cannot be carried out by DuckDB, and the input is a frugal duckplyr frame.
i Use `compute(prudence = "lavish")` to materialize to temporary storage and continue with duckplyr.
i See `vignette("funnel")` for other options.
i See `vignette("prudence")` for other options.
Caused by error in `rel_find_call()`:
! Function `desc` does not map to `dplyr::desc`.

File renamed without changes.
2 changes: 1 addition & 1 deletion tools/90-patch-dplyr.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ forbidden <- fs::path("R", c(
"zzz-methods.R",
"duckplyr-package.R",
"fallback.R",
"funnel.R",
"prudence.R",
"head.R",
"meta.R",
"n-col.R",
Expand Down
2 changes: 1 addition & 1 deletion vignettes/developers.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ data
nrow(data)
```

Learn more about prudence in `vignette("funnel")`, and about the translation employed by duckplyr in `vignette("limits")`.
Learn more about prudence in `vignette("prudence")`, and about the translation employed by duckplyr in `vignette("limits")`.
6 changes: 3 additions & 3 deletions vignettes/large.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Full compatibility means fewer surprises and less cognitive load for the user.
With DuckDB as the backend, duckplyr can also handle large data sets that do not fit into RAM, keeping full dplyr compatibility.
The tools for bringing data into and out of R memory are modeled after the dplyr and dbplyr packages, and are described in the following sections.

See `vignette("funnel")` on eager and lazy data, `vignette("limits")` for limitations in the translation employed by duckplyr, and `?fallback` for more information on fallback.
See `vignette("prudence")` on eager and lazy data, `vignette("limits")` for limitations in the translation employed by duckplyr, and `?fallback` for more information on fallback.


## To duckplyr
Expand Down Expand Up @@ -177,7 +177,7 @@ flights_parquet
In all cases, the data is read lazily: only the metadata is read initially, and the data is read as required.
This means that data can be read from files that are larger than the available RAM.
The Parquet format is particularly efficient for this purpose, as it stores data in a columnar format and allows reading only the columns that are required.
See `vignette("funnel")` for more details on the concept of lazy data.
See `vignette("prudence")` for more details on the concept of lazy data.

## From DuckDB

Expand Down Expand Up @@ -305,4 +305,4 @@ flights_parquet |>
group_by(Month)
```

See `vignette("funnel")` for the concepts and mechanisms at play.
See `vignette("prudence")` for the concepts and mechanisms at play.
4 changes: 3 additions & 1 deletion vignettes/funnel.Rmd → vignettes/prudence.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ system.time(mean_arr_delay_ewr$mean_arr_delay[[1]])

### Comparison

The functionality is similar to lazy tables in dbplyr and lazy frames in dtplyr. However, the behavior is different: at the time of writing, the internal structure of a lazy table or frame is different from a data frame, and columns cannot be accessed directly.
The functionality is similar to lazy tables in dbplyr and lazy frames in dtplyr.
However, the behavior is different: at the time of writing, the internal structure of a lazy table or frame is different from a data frame, and columns cannot be accessed directly.

| | **Eager** 😃 | **Lazy** 😴 |
|-------------|:------------:|:-----------:|
Expand All @@ -130,6 +131,7 @@ system.time(
)
```

See also the [duckplyr: dplyr Powered by DuckDB](https://duckdb.org/2024/04/02/duckplyr.html) blog post for more information.

## Prudence

Expand Down

0 comments on commit 6e976c5

Please sign in to comment.