Skip to content

Commit 126b85d

Browse files
committed
Check for empty dataset in _get_combined_statistics().
PiperOrigin-RevId: 387173414
1 parent 1052a49 commit 126b85d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tensorflow_data_validation/utils/display_util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ def _get_combined_statistics(
274274
'lhs_statistics is of type %s, should be '
275275
'a DatasetFeatureStatisticsList proto.' % type(lhs_statistics).__name__)
276276

277+
if not lhs_statistics.datasets:
278+
raise ValueError('lhs_statistics proto contains no dataset.')
279+
277280
if len(lhs_statistics.datasets) != 1:
278281
raise ValueError('lhs_statistics proto contains multiple datasets. Only '
279282
'one dataset is currently supported.')

0 commit comments

Comments
 (0)