Skip to content
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

Added fix and testcase for normalizing with DatetimeTimeIndex entry #749

merged 5 commits into from Sep 20, 2019


Copy link

commented Sep 17, 2019

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


This comment has been minimized.

Copy link

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/ 95.69% <100%> (+0.1%) ⬆️
featuretools/tests/entityset_tests/ 100% <100%> (ø) ⬆️
...computational_backends/ 98.23% <0%> (-0.01%) ⬇️
...utational_backend/ 99.37% <0%> (-0.01%) ⬇️
featuretools/tests/synthesis/ 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)))

This comment has been minimized.

Copy link

rwedge Sep 19, 2019


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

rwedge approved these changes Sep 20, 2019
Copy link

left a comment

Looks good!

@christopherbunn christopherbunn merged commit 07f6379 into master Sep 20, 2019
2 checks passed
2 checks passed
license/cla Contributor License Agreement is signed.
test_all_python_versions Workflow: test_all_python_versions
@christopherbunn christopherbunn deleted the normalize-dti branch Sep 20, 2019
@rwedge rwedge referenced this pull request Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.