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

Issue #427: Fix error in set_forecast_unit() that occurs when input is not a data.table #487

Merged
merged 5 commits into from
Nov 25, 2023

Conversation

nikosbosse
Copy link
Contributor

Fixes #427

set_forecast_unit() currently fails when the input is a data.frame() instead of a data.table(). This PR hotfixes the issue by making sure by calling as.data.table() on the input.


There exists also a more complete fix including tests and more thorough input checks in #437 that have already been reviewed and merged into the development branch. It would have been more ideal to target that PR to main instead of develop, but given that has already happened I think it is best to make a quick fix here. I ran the tests from the already reviewed PR here as well to make sure everything is working as expected, but didn't replicate them to avoid further merge conflicts due to variable names changing between main and dev.
Not ideal, apologies, will target main with future fixes like this one.

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4c3bcea) 90.91% compared to head (a1bd8a9) 90.92%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #487   +/-   ##
=======================================
  Coverage   90.91%   90.92%           
=======================================
  Files          23       23           
  Lines        1398     1399    +1     
=======================================
+ Hits         1271     1272    +1     
  Misses        127      127           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nikosbosse nikosbosse requested a review from seabbs November 20, 2023 16:42
This was referenced Nov 22, 2023
Copy link
Contributor

@seabbs seabbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd really rather this had a unit test and merge issues were dealt with but its better to get this fixed than not at all.

NEWS.md Outdated Show resolved Hide resolved
@nikosbosse nikosbosse merged commit 8ac4fc9 into main Nov 25, 2023
11 checks passed
@seabbs seabbs deleted the issue-427-fix-set-forecast-unit branch November 27, 2023 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error in set_forecast_unit
2 participants