diff --git a/odds/backend/processor/resource_processor.py b/odds/backend/processor/resource_processor.py index 8fe2fe6..22d228f 100644 --- a/odds/backend/processor/resource_processor.py +++ b/odds/backend/processor/resource_processor.py @@ -103,7 +103,8 @@ async def process(self, resource: Resource, dataset: Dataset, catalog: DataCatal values = [row[col_name] for row in data] true_values = [x for x in values if x is not None] field.sample_values = [str(x) for x, _ in Counter(values).most_common(10)] - field.missing_values_percent = int(100 * (len(values) - len(true_values)) / len(values)) + if len(values) > 0: + field.missing_values_percent = int(100 * (len(values) - len(true_values)) / len(values)) if field.data_type in ('number', 'integer', 'date', 'time', 'datetime'): try: field.max_value = str(max(true_values))