Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions python/ray/data/datasource/parquet_base_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,15 @@ def _open_input_source(
# Parquet requires `open_input_file` due to random access reads
return filesystem.open_input_file(path, **open_args)

def calculate_nulls(self, table):
total = 0
null = 0
for column in table.columns:
null += column.null_count
total += len(column)

percent = (total - null) / total
def calculate_nulls(self, table):
total = 0
null = 0
for column in table.columns:
null += column.null_count
total += len(column)

if total == 0:
return

percent = (total - null) / total
self.null_count_metric.observe(percent)