diff --git a/howso/utilities/feature_attributes/base.py b/howso/utilities/feature_attributes/base.py index c38961df..4680fce2 100644 --- a/howso/utilities/feature_attributes/base.py +++ b/howso/utilities/feature_attributes/base.py @@ -808,11 +808,8 @@ def _process(self, # noqa: C901 if infer_bounds: for feature_name in self.attributes: - # Don't infer bounds for manually-specified nominal features - if self.attributes[feature_name].get('type') == 'nominal': - continue - # Likewise, don't infer bounds for JSON/YAML features - elif any([ + # Don't infer bounds for JSON/YAML features + if any([ self.attributes[feature_name].get('data_type') in ['json', 'yaml'], features and features.get(feature_name, {}).get('data_type') in ['json', 'yaml'] ]): 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 9eb63acb..938ec258 100644 --- a/howso/utilities/feature_attributes/tests/test_infer_feature_attributes.py +++ b/howso/utilities/feature_attributes/tests/test_infer_feature_attributes.py @@ -836,9 +836,12 @@ def test_preset_feature_types(data, types, expected_types, is_valid): with warnings.catch_warnings(): warnings.simplefilter("ignore") if is_valid: - features = infer_feature_attributes(data, types=types) + features = infer_feature_attributes(data, types=types, ) for feature_name, expected_type in expected_types.items(): + # Make sure it is the correct type assert features[feature_name]['type'] == expected_type + # All features in this test, including nominals, should have bounds (at the very least: `allow_null`) + assert 'allow_null' in features[feature_name].get('bounds', {}).keys() else: with pytest.raises(ValueError): infer_feature_attributes(data, types=types)