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

Remove no selected columns warning #325

Merged
merged 12 commits into from
Oct 28, 2020
Merged

Remove no selected columns warning #325

merged 12 commits into from
Oct 28, 2020

Conversation

gsheni
Copy link
Contributor

@gsheni gsheni commented Oct 28, 2020

@gsheni gsheni self-assigned this Oct 28, 2020
@codecov
Copy link

codecov bot commented Oct 28, 2020

Codecov Report

Merging #325 into main will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #325   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines         2788      2741   -47     
=========================================
- Hits          2788      2741   -47     
Impacted Files Coverage Δ
woodwork/data_table.py 100.00% <ø> (ø)
woodwork/tests/data_table/test_datatable.py 100.00% <100.00%> (ø)

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 d6b9138...01b341a. Read the comment docs.

Copy link
Contributor

@thehomebrewnerd thehomebrewnerd left a comment

Choose a reason for hiding this comment

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

Maybe we should update the DataTable.select docstring to mention that if no columns are found matching the specified selectors that an empty DataTable will be returned? Not sure if that is necessary, but might be helpful to users.

@@ -1670,37 +1619,6 @@ def test_select_list_inputs(sample_df):
assert 'signup_date' in dt_common_tags.columns


def test_select_warnings(sample_df):
Copy link
Contributor

Choose a reason for hiding this comment

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

What to you think about leaving this test in place, renaming it to something more appropriate and just removing the with pytest.warns blocks. That way we have a test that confirms the proper behavior when we use an invalid selector, either alone or in combination with other valid selectors? I'm not sure we are testing that anywhere else.

Also, might consider adding assertions to confirm the underlying dataframe is empty or has the correct columns as well, in addition to just checking the DataTable.columns.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added test back, and renamed it. It also handles the situation of checking that empty datatable is returned.

@thehomebrewnerd thehomebrewnerd assigned gsheni and unassigned gsheni Oct 28, 2020
@thehomebrewnerd
Copy link
Contributor

thehomebrewnerd commented Oct 28, 2020

I think we should also remove the warning here. It is basically warning of the same thing, except inside of describe. This line is also causing a missed line in codecov. If we keep it, we should also add a test to hit this line.

https://github.com/FeatureLabs/woodwork/blob/a075e12d1cd43189b99ab0c20035cad1758f18a5/woodwork/data_table.py#L540

woodwork/data_table.py Outdated Show resolved Hide resolved
woodwork/data_table.py Outdated Show resolved Hide resolved
Copy link
Contributor

@thehomebrewnerd thehomebrewnerd 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!

@gsheni gsheni merged commit c3293e7 into main Oct 28, 2020
@gsheni gsheni mentioned this pull request Nov 11, 2020
@gsheni gsheni deleted the remove_no_col_warning branch November 13, 2020 20:11
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.

DataTable.select warns if no columns match
2 participants