Skip to content

Commit

Permalink
No more stringsAsFactors (#664)
Browse files Browse the repository at this point in the history
* No more stringsAsFactors

* Update NEWS

* Add error message for binary Python format we actually use

* Update NEWS
  • Loading branch information
juliasilge authored Oct 31, 2022
1 parent 37ef5eb commit 1d1113c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# pins (development version)

## Breaking changes

* Changed `type = "csv"` to use R's default value for `stringsAsFactors` i.e.
`FALSE` (#664).

## Other improvements

* Added vignette describing how to manage custom formats (#631, @ijlyttle).

* Improved error message for `pin_versions()` (#657).


# pins 1.0.3

* The `arrow` package is now suggested, rather than imported (#644, @jonthegeek).
Expand Down
4 changes: 3 additions & 1 deletion R/pin-read-write.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ object_write <- function(x, path, type = "rds") {
json = jsonlite::write_json(x, path, auto_unbox = TRUE),
arrow = write_arrow(x, path),
pickle = abort("'pickle' pins not supported in R"),
joblib = abort("'joblib' pins not supported in R"),
csv = utils::write.csv(x, path, row.names = FALSE),
qs = write_qs(x, path)
)
Expand Down Expand Up @@ -183,7 +184,8 @@ object_read <- function(meta) {
json = jsonlite::read_json(path, simplifyVector = TRUE),
arrow = read_arrow(path),
pickle = abort("'pickle' pins not supported in R"),
csv = utils::read.csv(path, stringsAsFactors = TRUE),
joblib = abort("'joblib' pins not supported in R"),
csv = utils::read.csv(path),
qs = read_qs(path),
file = abort(c(
"Pin does not declare file type so can't be automatically read",
Expand Down

0 comments on commit 1d1113c

Please sign in to comment.