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

Add "never" in quote_style #483

Merged
merged 5 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,5 @@ Collate:
'zzz.R'
Config/rextendr/version: 0.3.1
VignetteBuilder: knitr
Config/polars/LibVersion: 0.34.0
Config/polars/LibVersion: 0.34.1
Config/polars/RustToolchainVersion: nightly-2023-10-12
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# polars (development version)

## What's changed

- The argument `quote_style` in `$write_csv()` and `$sink_csv()` can now take
the value `"never"` (#483).

# polars 0.10.0

## BREAKING CHANGES DUE TO RUST-POLARS UPDATE
Expand Down
8 changes: 3 additions & 5 deletions R/dataframe__frame.R
Original file line number Diff line number Diff line change
Expand Up @@ -1749,11 +1749,9 @@ DataFrame_transpose = function(
#' * `"non_numeric"`: This puts quotes around all fields that are non-numeric.
#' Namely, when writing a field that does not parse as a valid float or integer,
#' then quotes will be used even if they aren`t strictly necessary.

# TODO: include "never" when bumping rust-polars to 0.34
# * `"never"`: This never puts quotes around fields, even if that results in
# invalid CSV data (e.g.: by not quoting strings containing the separator).

#' * `"never"`: This never puts quotes around fields, even if that results in
#' invalid CSV data (e.g. by not quoting strings containing the separator).
#'
#' @return
#' This doesn't return anything but creates a CSV file.
#'
Expand Down
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,6 @@ install.packages(

### Build from source

For source installation, pre-built Rust libraries may be available if
the environment variable `NOT_CRAN` is set to `"true"`. (Or, set
`LIBR_POLARS_BUILD` to `"false"`)

``` r
Sys.setenv(NOT_CRAN = "true")
install.packages("polars", repos = "https://rpolars.r-universe.dev")
```

Otherwise, the Rust library will be built from source. the Rust
toolchain (Rust 1.73 or later) must be configured.

Expand Down
2 changes: 2 additions & 0 deletions man/IO_sink_csv.Rd

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

2 changes: 2 additions & 0 deletions man/IO_write_csv.Rd

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

2 changes: 1 addition & 1 deletion src/rust/Cargo.lock

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

2 changes: 1 addition & 1 deletion src/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "r-polars"
version = "0.34.0"
version = "0.34.1"
edition = "2021"
rust-version = "1.73"
publish = false
Expand Down
7 changes: 4 additions & 3 deletions src/rust/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,11 @@ pub fn robj_to_quote_style(robj: Robj) -> RResult<pl::QuoteStyle> {
"always" => Ok(pl::QuoteStyle::Always),
"necessary" => Ok(pl::QuoteStyle::Necessary),
"non_numeric" => Ok(pl::QuoteStyle::NonNumeric),
// "never" is available in rust-polars devel only for now (will be added in 0.34)
// "never" => Ok(QuoteStyle::Never),
"never" => Ok(pl::QuoteStyle::Never),
_ => rerr()
.plain("a `quote_style` must be 'always', 'necessary' or 'non_numeric'.")
.plain(
"`quote_style` should be one of 'always', 'necessary', 'non_numeric', or 'never'.",
)
.bad_robj(&robj),
}
}
Expand Down
Loading
Loading