Conversation
Codecov Report
@@ Coverage Diff @@
## main #1854 +/- ##
==========================================
+ Coverage 98.82% 98.83% +0.01%
==========================================
Files 147 147
Lines 16290 16291 +1
==========================================
+ Hits 16099 16102 +3
+ Misses 191 189 -2
Continue to review full report at Codecov.
|
featuretools/primitives/utils.py
Outdated
| def camel_and_title_to_snake(name): | ||
| name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) | ||
| return re.sub('([a-z0-9])([A-Z])', r'\1_\2', name).lower() |
There was a problem hiding this comment.
I would expect "Top3Words" to be converted to "top_3_words" but currently this will return "top3_words"
|
A test just for the |
|
Is there somewhere in the documentation that we can put the new constraints on what primitive strings will be recognized? I guess we never specifically mentioned that they had to me the same as |
|
@dvreed77 Not sure if we need to handle this case, but wanted to note a potentially problematic string for I think we can avoid dealing with this specific example if we just use the word "Null" an time we might use "nan" in a primitive name, but it's something to keep in mind bc we can't stop users from trying to pass in that string |
| assert ft_semantic_tags.equals(ww_semantic_tags) | ||
|
|
||
|
|
||
| def test_camel_and_title_to_snake(): |
There was a problem hiding this comment.
can we include a snake case test case to confirm snake case passed in is unaltered?
Pull Request Description
Fixes #1761
implementation that allowed all variations of case and underscore: #1841
Feature Request
Provide convenience to a user by allowing them to pass a primitive name in either snake_case, TitleCase or camelCase
Implementation
Reduce TitleCase and camelCase into snake_case before matching them internally. This means we can't accept primitive names like "cOuNt" because it will be converted to "c_ou_nt". I think this is the desired behavior though
Assumptions: