@@ -166,8 +166,8 @@ prep.step_epi_YeoJohnson <- function(x, training, info = NULL, ...) {
166
166
limits = x $ limits ,
167
167
num_unique = x $ num_unique ,
168
168
na_rm = x $ na_rm ,
169
- forecast_date = attributes (training ) $ metadata $ as_of ,
170
- metadata = attributes (training ) $ metadata ,
169
+ forecast_date = attr (training , " metadata" ) $ as_of ,
170
+ metadata = attr (training , " metadata" ) ,
171
171
columns = col_names ,
172
172
skip = x $ skip ,
173
173
id = x $ id
@@ -179,13 +179,13 @@ bake.step_epi_YeoJohnson <- function(object, new_data, ...) {
179
179
# If not an epi_df, make it one assuming the template of training data.
180
180
# If it is an epi_df, check that the keys match.
181
181
# Imitating the pattern in step_adjust_latency().
182
- if (! inherits(new_data , " epi_df" ) || is.null(attributes (new_data ) $ metadata $ as_of )) {
182
+ if (! inherits(new_data , " epi_df" ) || is.null(attr (new_data , " metadata" ) $ as_of )) {
183
183
new_data <- as_epi_df(
184
184
new_data ,
185
185
as_of = object $ forecast_date ,
186
186
other_keys = object $ metadata $ other_keys %|| % character ()
187
187
)
188
- new_data % @ % metadata <- object $ metadata
188
+ attr( new_data , " metadata" ) <- object $ metadata
189
189
}
190
190
# Check that the keys match.
191
191
keys <- key_colnames(new_data , exclude = " time_value" )
0 commit comments