Skip to content

Commit a4b9436

Browse files
authored
h2oaiGH-16161 - add comparison to the test & dont write NA (h2oai#16195)
1 parent 5ffa80c commit a4b9436

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

h2o-parsers/h2o-parquet-parser/src/main/java/water/parser/parquet/FrameParquetExporter.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,9 @@ public void map(Chunk[] cs) {
112112
group = group.append(currColName, cs[j].at8(i));
113113
break;
114114
case (T_STR):
115-
if (cs[j].isNA(i)) {
116-
group = group.append(currColName, "");
117-
} else {
115+
if (!cs[j].isNA(i)) {
118116
group = group.append(currColName, cs[j].atStr(new BufferedString(), i).toString());
119-
}
117+
}
120118
break;
121119
case (T_CAT):
122120
if (cs[j].isNA(i)) {

h2o-py/tests/testdir_misc/pyunit_export_parquet_npe.py

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ def test_export_file_npe_gh_16161():
1010
with tempfile.TemporaryDirectory() as dir:
1111
df = h2o.create_frame(rows=100, cols=10, string_fraction=0.1, seed=5, seed_for_column_types=25)
1212
h2o.export_file(df, path=dir, format="parquet", write_checksum=False)
13+
df2 = h2o.import_file(dir)
14+
assert pyunit_utils.compare_frames(df, df2, tol_numeric=1e-10, numElements=0)
1315

1416

1517
if __name__ == "__main__":

0 commit comments

Comments
 (0)