Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check all calls to `as.data.table() to make sure they are not dropping classes we want to keep #587

Closed
nikosbosse opened this issue Jan 7, 2024 · 5 comments · Fixed by #802

Comments

@nikosbosse
Copy link
Contributor

nikosbosse commented Jan 7, 2024

As described in #559, some functions cause an object to lose its forecast_* class by calling as.data.table(). We should go through all functions to make sure this isn't happening / not causing any issues.
This likely means creating a unit test for any function that calls as.data.table() to make sure it has the output class we expect it to have.

@seabbs
Copy link
Contributor

seabbs commented Feb 28, 2024

The work I see for this is:

  • Make a generic test to see if the input and output of a function has the same class
  • Make a list of functions to apply this to
  • Iterate over the list and run the test
  • Fix any cases where issues are found
  • Leave in test suite to make sure we have good coverage of this problem going forward.

@nikosbosse
Copy link
Contributor Author

Excellent!

@nikosbosse
Copy link
Contributor Author

Are you fine with me moving this to 2.1.?

@seabbs
Copy link
Contributor

seabbs commented Apr 8, 2024

No not really. I think all functions should be clearly testing their output return is the class that is expected and we really want that in place now vs later.

I am worried that this will cause people a lot of code errors when porting their code and therefore a lot of frustration.

@nikosbosse
Copy link
Contributor Author

Hm... I don't really know how to implement this generic test (given that all the functions have different inputs). I think I'm just going to iterate over all functions and a test for their output class...

nikosbosse added a commit that referenced this issue May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants