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

Check argument types for .normalize_entity #195

Merged
merged 5 commits into from Jul 24, 2018

Conversation

Projects
None yet
4 participants
@xinbinhuang
Contributor

xinbinhuang commented Jul 23, 2018

Add exception handling to check argument types of copy_variables and addtional_variables for es.normalize_entity. #194

@CLAassistant

This comment has been minimized.

CLAassistant commented Jul 23, 2018

CLA assistant check
All committers have signed the CLA.

@codecov-io

This comment has been minimized.

codecov-io commented Jul 23, 2018

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #195      +/-   ##
==========================================
+ Coverage   93.21%   93.21%   +<.01%     
==========================================
  Files          70       70              
  Lines        7719     7727       +8     
==========================================
+ Hits         7195     7203       +8     
  Misses        524      524
Impacted Files Coverage Δ
featuretools/tests/entityset_tests/test_es.py 99.53% <100%> (ø) ⬆️
featuretools/entityset/entityset.py 93.81% <100%> (+0.04%) ⬆️

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 bdcd663...f93a90b. Read the comment docs.

@@ -800,6 +800,10 @@ def normalize_entity(self, base_entity_id, new_entity_id, index,
# variable_types = base_entity.variable_types
additional_variables = additional_variables or []
copy_variables = copy_variables or []
if not (isinstance(additional_variables, list) and isinstance(copy_variables, list)):

This comment has been minimized.

@kmax12

kmax12 Jul 23, 2018

Member

two comments

  1. Let's split this into two checks. one for additional_variables and another for copy_variables.
  2. Once we have two separate checks, let's make the error message more verbose e.g "additional_variables, must be a list, received type %s" % (type(additional_variables))"

This comment has been minimized.

@xinbinhuang

xinbinhuang Jul 23, 2018

Contributor

You are right! I will fix it within today.

@kmax12

This comment has been minimized.

Member

kmax12 commented Jul 24, 2018

@xinbinhuang the code and tests look good, but CI is failing because of linting. you can run the linting locally by running make lint from the root of the repo.

the errors I am seeing in CI are

featuretools/tests/entityset_tests/test_es.py:736:56: E251 unexpected spaces around keyword / parameter equals
featuretools/tests/entityset_tests/test_es.py:736:58: E251 unexpected spaces around keyword / parameter equals
featuretools/tests/entityset_tests/test_es.py:739:50: E251 unexpected spaces around keyword / parameter equals
featuretools/tests/entityset_tests/test_es.py:739:52: E251 unexpected spaces around keyword / parameter equals
featuretools/entityset/entityset.py:805:90: E502 the backslash is redundant between brackets
featuretools/entityset/entityset.py:809:84: E502 the backslash is redundant between brackets
Makefile:9: recipe for target 'lint' failed```
@xinbinhuang

This comment has been minimized.

Contributor

xinbinhuang commented Jul 24, 2018

Sorry, I forgot to check the linting locally before pushing. Just fixed the issue. It should be working now.

@kmax12

This comment has been minimized.

Member

kmax12 commented Jul 24, 2018

Looks great! Thank you for your contribution. Merging

@kmax12 kmax12 merged commit ee25b59 into Featuretools:master Jul 24, 2018

2 checks passed

ci/circleci Your tests passed on CircleCI!
Details
license/cla Contributor License Agreement is signed.
Details

@rwedge rwedge referenced this pull request Aug 20, 2018

Merged

v0.2.2 #220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment