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
Handle return type when creating features from Id variables #318
Conversation
Codecov Report
@@ Coverage Diff @@
## master #318 +/- ##
==========================================
+ Coverage 95.22% 95.22% +<.01%
==========================================
Files 71 71
Lines 7681 7692 +11
==========================================
+ Hits 7314 7325 +11
Misses 367 367
Continue to review full report at Codecov.
|
|
||
def test_return_type_inference_id(es_numeric): | ||
mode = Mode(es_numeric["log"]["session_id"], es_numeric["customers"]) | ||
assert mode.variable_type == Categorical |
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.
Should we also test the Direct Feature case
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.
sure. added
@@ -100,12 +102,14 @@ def entity(self): | |||
# P TODO: this should get refactored to return_type | |||
@property | |||
def variable_type(self): | |||
from . import direct_feature |
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.
Should we move this import up to the top?
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.
direct_feature imports this file, so we have to include this here to avoid the circular reference.
in #326, the directory structure changes things around and actually moves DirectFeature
into this file, so we'll likely be able to update this when that PR gets merged in.
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.
makes sense
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.
Looks good
When we create a feature from an Id variable, its return type should get converted to a Categorical because it is no longer an Id variable unless it is a direct feature.
This will remove features like
CUM_SUM(SUM(order_products.total) by MODE(order_products.product_id))
Same as #266, but for Id variable types