Skip to content

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

Merged
merged 5 commits into from
Sep 20, 2019

Conversation

christopherbunn
Copy link
Contributor

Fixes #740 by setting all DatetimeTimeIndex variables in additional_variable and copy_variables to Datetime

@codecov
Copy link

codecov bot commented Sep 17, 2019

Codecov Report

Merging #749 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #749      +/-   ##
==========================================
+ Coverage   97.65%   97.65%   +<.01%     
==========================================
  Files         118      118              
  Lines       10364    10381      +17     
==========================================
+ Hits        10121    10138      +17     
  Misses        243      243
Impacted Files Coverage Δ
featuretools/entityset/entityset.py 95.69% <100%> (+0.1%) ⬆️
featuretools/tests/entityset_tests/test_es.py 100% <100%> (ø) ⬆️
...computational_backends/calculate_feature_matrix.py 98.23% <0%> (-0.01%) ⬇️
...utational_backend/test_calculate_feature_matrix.py 99.37% <0%> (-0.01%) ⬇️
featuretools/tests/synthesis/test_dfs_method.py 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ff8d17...bea8167. Read the comment docs.

@@ -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)))
Copy link
Contributor

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

Copy link
Contributor

@rwedge rwedge left a comment

Choose a reason for hiding this comment

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

Looks good!

@christopherbunn christopherbunn merged commit 07f6379 into master Sep 20, 2019
@christopherbunn christopherbunn deleted the normalize-dti branch September 20, 2019 15:25
@rwedge rwedge mentioned this pull request Sep 30, 2019
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.

normalize_entity errors when copying time index variable to new, non-time-indexed entity
2 participants