Skip to content

Commit

Permalink
21718: IFA reports 'allow_null': True for all-null columns
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaze committed Oct 18, 2024
1 parent 580088d commit f2b6d82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion howso/utilities/feature_attributes/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ def _as_float(value, dtype):
min_value, max_value = self._get_min_max_number_size_bounds(
feature_attributes, feature_name)
if min_value is not None and max_value is not None:
output = {'min': min_value, 'max': max_value}
output = {'min': min_value, 'max': max_value, 'allow_null': allow_null}
else:
output = {'allow_null': allow_null}

else: # Ordinals
output = {'allow_null': allow_null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ def test_dependent_features(should_include, base_features, dependent_features):
(None, [2, 2, 2, 2, 4, 5, 6, 6, 6, 6], {'min': 2, 'max': 6, 'allow_null': False}),
(None, [2, 2, 2, 2, 4, 5, 6, 6, 6, 6, 6], {'min': 1, 'max': 6, 'allow_null': False}),
(None, [2, 2, 2, 2, 4, 5, 6, 7], {'min': 2, 'max': 7, 'allow_null': False}),
(None, [float('nan'), float('nan')], {'allow_null': True}),
(['a'], [2, 3, 4, 5, 6, 7], {'min': 2, 'max': 7, 'allow_null': False}),
(['a'], [2, 3, 4, None, 6, 7], {'min': 2, 'max': 7, 'allow_null': True}),
(
Expand Down

0 comments on commit f2b6d82

Please sign in to comment.