diff --git a/howso/utilities/feature_attributes/pandas.py b/howso/utilities/feature_attributes/pandas.py index 82672ce3..558e7fc3 100644 --- a/howso/utilities/feature_attributes/pandas.py +++ b/howso/utilities/feature_attributes/pandas.py @@ -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} diff --git a/howso/utilities/feature_attributes/tests/test_infer_feature_attributes.py b/howso/utilities/feature_attributes/tests/test_infer_feature_attributes.py index f452cf66..3c7b33e6 100644 --- a/howso/utilities/feature_attributes/tests/test_infer_feature_attributes.py +++ b/howso/utilities/feature_attributes/tests/test_infer_feature_attributes.py @@ -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}), (