mlr3temporal icon indicating copy to clipboard operation
mlr3temporal copied to clipboard

Trivial check in TaskForecast class?

Open MislavSag opened this issue 2 years ago • 2 comments

Description

I am inspecting code for TaskForecast class. In this part:

    data = function(rows = NULL, cols = NULL, data_format = "data.table") {
      data = super$data(rows, cols, data_format)
      # Order data by date: FIXME: Should this happen here or in the backend.
      date = self$date(rows)
      assert_true(nrow(data) == nrow(data))
      data[order(date), ]
    },

it check if nrow(data) == nrow(data) which doesn't make sense? Maybe it is:

`nrow(data) == nrow(date)` 

?

Reproducible example

    data = function(rows = NULL, cols = NULL, data_format = "data.table") {
      data = super$data(rows, cols, data_format)
      # Order data by date: FIXME: Should this happen here or in the backend.
      date = self$date(rows)
      assert_true(nrow(data) == nrow(data))
      data[order(date), ]
    },

MislavSag avatar Feb 09 '23 08:02 MislavSag