From 41e4050642adc8ea71b928905b6061f9d4fa2411 Mon Sep 17 00:00:00 2001 From: simonpcouch Date: Mon, 15 Jul 2024 12:23:21 -0500 Subject: [PATCH] address inflation of `model_stack` object size --- NEWS.md | 3 +++ R/blend_predictions.R | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/NEWS.md b/NEWS.md index 3f1d579..04b547d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # stacks (development version) +* Addressed inflation of butchered model stack object size after saving and + reloading (#214). + # stacks 1.0.4 * Introduced support for parallel processing using the [future](https://www.futureverse.org/) framework. The stacks package previously supported parallelism with foreach, and users can use either framework for now. In a future release, stacks will begin the deprecation cycle for parallelism with foreach, so we encourage users to begin migrating their code now. See [the _Parallel Processing_ section in the tune package's "Optimizations" article](https://tune.tidymodels.org/articles/extras/optimizations.html#parallel-processing) to learn more (#866). diff --git a/R/blend_predictions.R b/R/blend_predictions.R index 759f767..4f38a15 100644 --- a/R/blend_predictions.R +++ b/R/blend_predictions.R @@ -357,6 +357,11 @@ check_blend_data_stack <- function(data_stack) { process_data_stack <- function(data_stack) { dat <- tibble::as_tibble(data_stack) %>% na.omit() + + # retain only the tbl_df attributes (#214) + attributes(dat) <- attributes(dat)[ + names(attributes(tibble::new_tibble(list()))) + ] if (nrow(dat) == 0) { cli_abort(