Skip to content

Commit

Permalink
fix java tests compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
krasinski committed Oct 29, 2024
1 parent e919ad3 commit d366838
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion h2o-core/src/main/java/water/parser/ParseSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public ParseSetup(ParserInfo parseType, byte sep, boolean singleQuotes, int chec
int ncols, String[] columnNames, byte[] ctypes,
String[][] domains, String[][] naStrings, String[][] data, boolean tzAdjustToLocal) {
this(parseType, sep, singleQuotes, checkHeader, ncols, columnNames, ctypes,
domains, naStrings, data, new ParseWriter.ParseErr[0], FileVec.DFLT_CHUNK_SIZE, null, ParseSetup.DEFAULT_ESCAPE_CHAR,tzAdjustToLocal);
domains, naStrings, data, new ParseWriter.ParseErr[0], FileVec.DFLT_CHUNK_SIZE, null, ParseSetup.DEFAULT_ESCAPE_CHAR, tzAdjustToLocal);
}

public ParseSetup(ParserInfo parseType, byte sep, boolean singleQuotes, int checkHeader,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class ParseCompressedAndXLSTest extends TestUtil {
12, // ncols
new String[]{"fYear", "fMonth", "fDayofMonth", "fDayOfWeek", "DepTime", "ArrTime", "UniqueCarrier", "Origin", "Dest", "Distance", "IsDepDelayed", "IsDepDelayed_REC"},
ctypes,
null, null, null, null, null);
null, null, null, null, null, false);
try {
k1 = ParseDataset.parse(Key.make(), new Key[]{nfs._key}, true, setup, true)._job.get();
assertTrue("Should have thrown ParseException since file isn't XLS file",false); // fail - should've thrown
Expand Down
8 changes: 4 additions & 4 deletions h2o-core/src/test/java/water/parser/ParserTest2.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private static void testParsed(Frame fr, String[][] expected) {
Key rkey = FVecFactory.makeByteVec(data);
ParseSetup ps = new ParseSetup(CSV_INFO, (byte)',', false, ParseSetup.HAS_HEADER, 9,
new String[]{"'C1Chunk'","C1SChunk", "'C2Chunk'", "'C2SChunk'", "'C4Chunk'", "'C4FChunk'", "'C8Chunk'", "'C8DChunk'", "'Categorical'"},
ParseSetup.strToColumnTypes(new String[]{"Numeric", "Numeric", "Numeric", "Numeric", "Numeric", "Numeric", "Numeric", "Numeric", "Enum"}), null, null, null, null, null);
ParseSetup.strToColumnTypes(new String[]{"Numeric", "Numeric", "Numeric", "Numeric", "Numeric", "Numeric", "Numeric", "Numeric", "Enum"}), null, null, null, null, null, false);
Frame fr = ParseDataset.parse(Key.make("na_test.hex"), new Key[]{rkey}, true, ps);
int nlines = (int)fr.numRows();
Assert.assertEquals(9,nlines);
Expand Down Expand Up @@ -101,7 +101,7 @@ private static void testParsed(Frame fr, String[][] expected) {
ParseSetup ps = new ParseSetup(CSV_INFO, (byte)',', false, ParseSetup.HAS_HEADER, 4,
new String[]{"'C1'","'C2'", "'C3'", "'C4'"},
ParseSetup.strToColumnTypes(new String[]{"Numeric", "Numeric", "Numeric", "Numeric"}),
null, null, null, null, null);
null, null, null, null, null, false);
Frame fr = null;
try {
fr = ParseDataset.parse(Key.make("blank_lines_test.hex"), new Key[]{dataKey}, true, ps);
Expand All @@ -124,15 +124,15 @@ private static void testParsed(Frame fr, String[][] expected) {
ar("last","'line''s","trailing","piece'") };
Key k = FVecFactory.makeByteVec(data);

ParseSetup gSetupF = ParseSetup.guessSetup(null, StringUtils.bytesOf(data[0]), new ParseSetup(CSV_INFO, (byte)',', false/*single quote*/, 4, ParseSetup.NO_HEADER, null, null, null, null, null));
ParseSetup gSetupF = ParseSetup.guessSetup(null, StringUtils.bytesOf(data[0]), new ParseSetup(CSV_INFO, (byte)',', false/*single quote*/, 4, ParseSetup.NO_HEADER, null, null, null, null, null, false));
gSetupF._column_types = ParseSetup.strToColumnTypes(new String[]{"Enum", "Enum", "Enum", "Enum"});
Frame frF = ParseDataset.parse(Key.make(), new Key[]{k}, false, gSetupF);
testParsed(frF,expectFalse);

String[][] expectTrue = new String[][] { ar("Tomass,test,first,line", null),
ar("Tomas''stest2","test2"),
ar("last", "lines trailing piece") };
ParseSetup gSetupT = ParseSetup.guessSetup(null, StringUtils.bytesOf(data[0]), new ParseSetup(CSV_INFO, (byte)',', true/*single quote*/, 2, ParseSetup.NO_HEADER, null, null, null, null, null));
ParseSetup gSetupT = ParseSetup.guessSetup(null, StringUtils.bytesOf(data[0]), new ParseSetup(CSV_INFO, (byte)',', true/*single quote*/, 2, ParseSetup.NO_HEADER, null, null, null, null, null, false));
gSetupT._column_types = ParseSetup.strToColumnTypes(new String[]{"Enum", "Enum", "Enum", "Enum"});
Frame frT = ParseDataset.parse(Key.make(), new Key[]{k}, true, gSetupT);
//testParsed(frT,expectTrue); // not currently passing
Expand Down

0 comments on commit d366838

Please sign in to comment.