Skip to content

Commit

Permalink
GH-16161 Fix parquet export NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
krasinski committed Apr 23, 2024
1 parent adeebb5 commit 6879ffd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ public void map(Chunk[] cs) {
group = group.append(currColName, cs[j].at8(i));
break;
case (T_STR):
group = group.append(currColName, cs[j].atStr(new BufferedString(), i).toString());
if (cs[j].isNA(i)) {
group = group.append(currColName, "");
} else {
group = group.append(currColName, cs[j].atStr(new BufferedString(), i).toString());
}
break;
case (T_CAT):
if (cs[j].isNA(i)) {
Expand Down
21 changes: 21 additions & 0 deletions h2o-py/tests/testdir_misc/pyunit_export_parquet_npe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import sys
import tempfile

sys.path.insert(1, "../../../")
import h2o
from tests import pyunit_utils


def test_export_file_npe_gh_16161():
with tempfile.TemporaryDirectory() as dir:
df = h2o.create_frame(rows=100, cols=10, string_fraction=0.1, seed=5, seed_for_column_types=25)
h2o.export_file(df, path=dir, format="parquet", write_checksum=False)


if __name__ == "__main__":
pyunit_utils.standalone_test(test_export_file_npe_gh_16161)
else:
test_export_file_npe_gh_16161()



0 comments on commit 6879ffd

Please sign in to comment.