Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Apr 11, 2022
1 parent 57fb288 commit ce2a554
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/vaex-core/vaex/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,9 @@ def _decode(cls, encoding, spec):
return ds

def is_masked(self, column):
for dataset in self.datasets:
if column not in dataset:
return True
return any(k.is_masked(column) for k in self.datasets)

def shape(self, column):
Expand Down
2 changes: 2 additions & 0 deletions tests/concat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ def test_concat_unaligned_schema(arrow):
df = df1.concat(df2)
assert df.x.tolist() == [1, 2, None, None]
assert df.y.tolist() == [None, None, 'd', 'e']
assert df.is_masked('x')
assert df.is_masked('y')
# always 'upcast' to Arrow arrays
# # rationale: Arrow will use use less memory, numpy has no efficient way to represent all missing data
assert df.x.data_type() == pa.float32()
Expand Down
2 changes: 1 addition & 1 deletion tests/export_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def test_export_concat_missing_cols_hdf5(tmpdir):
df.export_hdf5(filename)

df_opened = vaex.open(filename)
assert df_opened.x.tolist() == [1, 2, 3, 7, 8, 9]
assert df_opened.x.tolist() == [1, 2, 3, 4, 5, 6]
assert df_opened.y.tolist() == [10, 20, 30, None, None, None]
assert df_opened.s.tolist() == ['x1', 'x2', 'x3', None, None, None]

Expand Down

0 comments on commit ce2a554

Please sign in to comment.