Skip to content

Commit

Permalink
fix: task hash
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Nov 5, 2024
1 parent ea53d4a commit 80c92da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/helper_hashes.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ task_hash = function(task, use_ids, test_ids = NULL, ignore_internal_valid_task
task$backend$hash,
task$col_info,
use_ids,
task$col_roles,
get_private(task)$.properties,
internal_valid_task_hash)
}
8 changes: 8 additions & 0 deletions tests/testthat/test_Task.R
Original file line number Diff line number Diff line change
Expand Up @@ -661,3 +661,11 @@ test_that("cbind supports non-standard primary key (#961)", {
task$cbind(data.table(x1 = 10:1))
expect_true("x1" %in% task$feature_names)
})

test_that("$select changes hash", {
task = tsk("iris")
h1 = task$hash
task$select("Petal.Length")
h2 = task$hash
expect_false(h1 == h2)
})

0 comments on commit 80c92da

Please sign in to comment.