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
Remove primitives that return strings instead of functions #499
Conversation
Codecov Report
@@ Coverage Diff @@
## master #499 +/- ##
==========================================
- Coverage 96.1% 96.09% -0.01%
==========================================
Files 108 108
Lines 8853 8862 +9
==========================================
+ Hits 8508 8516 +8
- Misses 345 346 +1
Continue to review full report at Codecov.
|
@@ -26,7 +26,7 @@ class Count(AggregationPrimitive): | |||
default_value = 0 | |||
|
|||
def get_function(self): | |||
return 'count' | |||
return pd.Series.count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this actually isn't as performant. added question on stackoverflow here: https://stackoverflow.com/questions/55731149/use-a-function-instead-of-string-in-pandas-groupby-agg
@@ -261,7 +261,7 @@ class Skew(AggregationPrimitive): | |||
stack_on_self = False | |||
|
|||
def get_function(self): | |||
return 'skew' | |||
return pd.Series.skew |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cbe1eb0
to
8a7b3fd
Compare
Looks good |
We were returning strings in some cases to improve performance. This breaks api with other primitives. We can simply return pandas objects instead add the string optimization into pandas backend.