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

raise error for wrong input in ignore_variables #826

Merged
merged 13 commits into from Nov 30, 2019

Conversation

@systemshift
Copy link
Contributor

systemshift commented Nov 22, 2019

Pull Request Description

As mentioned in #818, ignore_variables does not raise error when given a wrong input.
Currently it checks if the input is {str: list} only, would like to know if its needed to check the values of the list to be string or not.


After creating the pull request: in order to pass the changelog_updated check you will need to update the "Future Release" section of docs/source/changelog.rst to include this pull request.

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Nov 22, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #826      +/-   ##
==========================================
+ Coverage   98.15%   98.15%   +<.01%     
==========================================
  Files         121      121              
  Lines       10920    10939      +19     
==========================================
+ Hits        10718    10737      +19     
  Misses        202      202
Impacted Files Coverage Δ
featuretools/synthesis/deep_feature_synthesis.py 97.04% <100%> (+0.02%) ⬆️
...ols/tests/synthesis/test_deep_feature_synthesis.py 99.09% <100%> (+0.02%) ⬆️

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 0783ccc...28db64f. Read the comment docs.

@@ -165,6 +165,9 @@ def __init__(self,

self.ignore_variables = defaultdict(set)
if ignore_variables is not None:
# check if ignore_variables is not {str: list}
if not all(isinstance(i, str) for i in ignore_variables.keys()) or not all(isinstance(i, list) for i in ignore_variables.values()):
raise TypeError('ignore_variables should be dict[str -> list[str]]')

This comment has been minimized.

Copy link
@rwedge

rwedge Nov 25, 2019

Collaborator

Could you add a test case that triggers this error?

systemshift added 2 commits Nov 26, 2019
@@ -162,6 +162,18 @@ def test_ignores_variables(es):
assert 'value' not in variables


@pytest.fixture

This comment has been minimized.

Copy link
@rwedge

rwedge Nov 26, 2019

Collaborator

This shouldn't be a pytest fixture. Fixtures are functions that get used by the test cases. For example, this test case uses the es fixture, which returns an entityset.

@systemshift

This comment has been minimized.

Copy link
Contributor Author

systemshift commented Nov 26, 2019

Now it would be a good time to know if I should add the third check to see if the list is made of exclusively strings, and not say, ints or floats.

@rwedge

This comment has been minimized.

Copy link
Collaborator

rwedge commented Nov 26, 2019

That would be good to check as well.

I think only the new "fixes" changelog entry is necessary. The "testing changes" section is for PRs that only change the tests.

@rwedge

This comment has been minimized.

Copy link
Collaborator

rwedge commented Nov 30, 2019

we should also test for the case where not all keys are string type

systemshift and others added 5 commits Nov 30, 2019
@rwedge
rwedge approved these changes Nov 30, 2019
Copy link
Collaborator

rwedge left a comment

Looks good!

@rwedge rwedge merged commit 5f72d96 into FeatureLabs:master Nov 30, 2019
4 checks passed
4 checks passed
codecov/patch 100% of diff hit (target 98.15%)
Details
codecov/project 98.15% (+<.01%) compared to 0783ccc
Details
license/cla Contributor License Agreement is signed.
Details
test_all_python_versions Workflow: test_all_python_versions
Details
@systemshift systemshift deleted the systemshift:check_ignore_variable branch Nov 30, 2019
@rwedge rwedge mentioned this pull request Dec 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.