tidyverts / fabletools

General fable features useful for extension packages
http://fabletools.tidyverts.org/
89 stars 31 forks source link

augment.mdl_ts not returning distinct rows identified by key and index #238

Closed tanner-ellison closed 4 years ago

tanner-ellison commented 4 years ago

It appears that augment doesn't persist the key and/or index when retaining or transforming back to a tsibble

tsibbledata::olympic_running %>% 
aggregate_key(Length * Sex, Time = mean(Time)) %>%
model(mean = MEAN(Time), naive = NAIVE(Time)) %>% 
augment()

Error : A valid tsibble must have distinct rows identified by key and index.
ℹ Please use `duplicates()` to check the duplicated rows.

P.S. (I hope this is the right way to be bringing up these discoveries. I am new to github so I will appreciate any feedback needed. It happens to appear that I am looking for these because I am using this for my work and it is a breaking issue.)

mitchelloharawild commented 4 years ago

Yep, these are great! This was introduced by dbc5333fab1c20b0689d985d50196638096d778d, which I'm also working on fixing now. I noticed this issue when fixing #237

mitchelloharawild commented 4 years ago

Should be working well now. Thanks for the bug reports! Since you asked for feedback, you may find the reprex::reprex() function useful for sharing code that contains errors. More details at https://www.tidyverse.org/help/