-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-15947: fixed column length discrepancies when skipped_columns are …
…specified when calling h2o.H2OFrame. GH-15947: fixed skipped columns for normal import_file path. GH-15947: added same skipped column capability when transforming R data frames to h2O data frames. GH-15947: add parameter to avoid R cmd test failure. GH-15947: Incorporate Seb code review comments.
- Loading branch information
wendycwong
committed
May 23, 2024
1 parent
a72a974
commit da7946f
Showing
7 changed files
with
56 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
h2o-py/tests/testdir_parser/pyunit_GH_15947_skipped_column_error.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import sys | ||
sys.path.insert(1,"../../") | ||
import h2o | ||
from tests import pyunit_utils | ||
|
||
# Seb has reported that skipped_columns does not work if skipped_columns is called with h2o.H2OFrame | ||
def test_skipped_columns(): | ||
data = [[1, 4, "a", 1], [2, 5, "b", 0], [3, 6, "", 1]] | ||
frame = h2o.H2OFrame(data, skipped_columns=[1, 2]) | ||
assert frame.ncol == 2, "Expected column number: 2. Actual: {0}".format(frame.ncol) | ||
|
||
if __name__ == "__main__": | ||
pyunit_utils.standalone_test(test_skipped_columns) | ||
else: | ||
test_skipped_columns() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
h2o-r/tests/testdir_parser/runit_GH_15947_skipped_column_error.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))) | ||
source("../../scripts/h2o-r-test-setup.R") | ||
|
||
test.skipped_columns <- function() { | ||
iris_hf <- as.h2o(iris, skipped_columns=c(1,2)) | ||
expect_true(ncol(iris_hf) == (ncol(iris)-2)) | ||
print("Columns are skipped!!!") | ||
} | ||
|
||
doTest("Test skipped_columns when using as.h2o to change data frame to H2O Frame.", test.skipped_columns) |