Skip to content

Add test suite forNumCharactersand modify docstring #2463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jan 27, 2023

Conversation

sbadithe
Copy link
Contributor

@sbadithe sbadithe commented Jan 25, 2023

@sbadithe sbadithe force-pushed the Add-num-characters-tests branch from 3bddcb1 to bdd58c3 Compare January 25, 2023 05:16
@sbadithe sbadithe force-pushed the Add-num-characters-tests branch from 0a8ab33 to e30b4c1 Compare January 25, 2023 06:18
# Convert boolean column to be float64
if pd.api.types.is_bool_dtype(more_complex_col):
# Convert boolean or Int64 column to be float64
if pd.api.types.is_bool_dtype(more_complex_col) or isinstance(
Copy link
Contributor Author

@sbadithe sbadithe Jan 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing NumCharacters to return IntegerNullable triggered an error here. Int64 doesn't seem to support the corr operation. There is a _is_integer_dtype function, but that would cast a wider net and grab series with the int64 dtype. This way is a little more selective and does the conversion less often.

@sbadithe sbadithe marked this pull request as ready for review January 25, 2023 06:26
@sbadithe sbadithe changed the title Add test for NumCharacters Add test suite for NumCharacters Jan 25, 2023
@codecov
Copy link

codecov bot commented Jan 27, 2023

Codecov Report

Merging #2463 (3f082bf) into main (1f04ed3) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #2463   +/-   ##
=======================================
  Coverage   99.42%   99.42%           
=======================================
  Files         354      355    +1     
  Lines       21385    21421   +36     
=======================================
+ Hits        21261    21297   +36     
  Misses        124      124           
Impacted Files Coverage Δ
...ools/tests/primitive_tests/test_primitive_utils.py 100.00% <ø> (ø)
...ndard/transform/natural_language/num_characters.py 100.00% <100.00%> (ø)
featuretools/selection/selection.py 100.00% <100.00%> (ø)
...l_language_primitives_tests/test_num_characters.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@thehomebrewnerd thehomebrewnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. My only minor nitpick is that is unrelated to this change, is that perhaps we should update the primitive docstring to make it more clear that this primitive counts all characters, including whitespace and punctuation, but that's not a big deal.

@sbadithe sbadithe changed the title Add test suite for NumCharacters UpdateNumCharactersdocstring and test suite Jan 27, 2023
@sbadithe sbadithe changed the title UpdateNumCharactersdocstring and test suite UpdateNumCharactersdocstring and add test suite Jan 27, 2023
@sbadithe sbadithe changed the title UpdateNumCharactersdocstring and add test suite Add test suite forNumCharactersand modify docstring Jan 27, 2023
@sbadithe sbadithe merged commit 9211073 into main Jan 27, 2023
@sbadithe sbadithe deleted the Add-num-characters-tests branch January 27, 2023 22:51
@sbadithe sbadithe mentioned this pull request Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NumCharacters does not have test suite
2 participants