-
Notifications
You must be signed in to change notification settings - Fork 898
Added fix and testcase for normalizing with DatetimeTimeIndex entry #749
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #749 +/- ##
==========================================
+ Coverage 97.65% 97.65% +<.01%
==========================================
Files 118 118
Lines 10364 10381 +17
==========================================
+ Hits 10121 10138 +17
Misses 243 243
Continue to review full report at Codecov.
|
featuretools/entityset/entityset.py
Outdated
@@ -593,6 +598,9 @@ def normalize_entity(self, base_entity_id, new_entity_id, index, | |||
elif make_time_index: | |||
# Create a new time index based on the base entity time index. | |||
base_time_index = base_entity.time_index | |||
t_index = base_entity[base_time_index] | |||
if not isinstance(t_index, (vtypes.NumericTimeIndex, vtypes.DatetimeTimeIndex)): | |||
raise TypeError("{0} is not a NumericTimeIndex or DatetimeTimeIndex, but type {1}".format(base_time_index, type(t_index))) |
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.
Let's start the error message with "Time index {0}" so there's more context about the error. And at the end of the error message we can add a suggestion for fixing it by running set_time_index
on the entity.
I think we should make this a sanity check we run any time normalize_entity
is called since if this gets triggered the entity is definitely misconfigured
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!
Fixes #740 by setting all DatetimeTimeIndex variables in
additional_variable
andcopy_variables
to Datetime