-
Notifications
You must be signed in to change notification settings - Fork 883
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
Ensure relationship variables are the same underlying dtype #155
Conversation
Codecov Report
@@ Coverage Diff @@
## master #155 +/- ##
==========================================
+ Coverage 92.59% 92.62% +0.03%
==========================================
Files 72 72
Lines 7722 7729 +7
==========================================
+ Hits 7150 7159 +9
+ Misses 572 570 -2
Continue to review full report at Codecov.
|
if ((is_object_dtype(parent_e.df[parent_v]) or | ||
is_string_dtype(parent_e.df[parent_v])) and | ||
is_numeric_dtype(child_e.df[child_v])): | ||
parent_e.df[parent_v] = pd.to_numeric(self[parent_e.id].df[parent_v]) |
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.
The self[parent_e.id]
here can be changed to parent_e.df
target_entity="sessions", | ||
agg_primitives=["mean", "sum", "mode"], | ||
trans_primitives=["month", "hour"], | ||
max_depth=2) |
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.
A little weird that this test has no assertions. Maybe assert that the normalize successfully converted both parent and child values to matching types? Or maybe the test should go in test_es:test_add_relationship_converts_types
If a parent entity has an index with integer data, and the linking variable in the child has object/string data, this will convert the child variable to integers. This is necessary for the new version of pandas (0.23), because merges on mixed dtypes are not allowed.