Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
akoumjian committed Jan 13, 2025
1 parent 33cfa19 commit 08ac772
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions quivr/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,12 +1002,12 @@ def separate_invalid(self) -> Tuple[Self, Self]:
valid = self.apply_mask(pyarrow.compute.invert(failure_indices))
invalid = self.apply_mask(failure_indices)
return valid, invalid

def null_mask(self) -> pa.Array:
"""Return a boolean mask indicating which rows of the entire table are null."""
# Get the null mask for each column
flattened_table = self.flattened_table()
mask = pa.repeat(True, len(flattened_table ))
mask = pa.repeat(True, len(flattened_table))
for name in flattened_table.column_names:
mask = pc.and_(mask, pc.is_null(flattened_table.column(name)))
return pa.array(mask, type=pa.bool_())
Expand All @@ -1022,7 +1022,6 @@ def empty(cls, **kwargs: AttributeValueType) -> Self:
empty_table = pa.table(data, schema=cls.schema)
return cls.from_pyarrow(table=empty_table, validate=False, permit_nulls=False, **kwargs)


@classmethod
def nulls(cls, size: int, **kwargs: AttributeValueType) -> Self:
"""Create a table with nulls.
Expand Down

0 comments on commit 08ac772

Please sign in to comment.