Skip to content

Commit

Permalink
Merge pull request #166 from paleolimbot/fix-data-frame
Browse files Browse the repository at this point in the history
Explicitly throw error instead of rely on NextMethod()
  • Loading branch information
paleolimbot authored Dec 9, 2022
2 parents 1b0078a + ad2eb91 commit bc75ece
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# wk (development version)

* Fix implicit reliance on error `as.data.frame.default()`,
which no longer occurs in r-devel (#166).

# wk 0.7.0

* Remove legacy headers that are no longer used by any downstream package
Expand Down
2 changes: 1 addition & 1 deletion R/wk-vctr.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ rep_len.wk_vctr <- function(x, ...) {
#' @export
as.data.frame.wk_vctr <- function(x, ..., optional = FALSE) {
if (!optional) {
NextMethod()
stop(sprintf("cannot coerce object of tyoe '%s' to data.frame", class(x)[1]))
} else {
new_data_frame(list(x))
}
Expand Down

0 comments on commit bc75ece

Please sign in to comment.