Skip to content

MNT refactor tests for datasets - #17599

Merged
adrinjalali merged 3 commits into
scikit-learn:masterfrom
glemaitre:is/common_tests_as_frame
Jun 16, 2020
Merged

adrinjalali merged 3 commits into
scikit-learn:masterfrom
glemaitre:is/common_tests_as_frame

Conversation

@glemaitre

Copy link
Copy Markdown
Member

refactor tests for the datasets module to:

  • parametrize the load_* functions
  • create common tests for: as_frame and return_X_y support.

@glemaitre

Copy link
Copy Markdown
Member Author

This is coming in support of PR implementing support for as_frame and ensuring basic type checking for the fetcher then.

@glemaitre

Copy link
Copy Markdown
Member Author

ping @thomasjpfan @rth @adrinjalali Since you were involved in those.

@glemaitre

Copy link
Copy Markdown
Member Author

@amueller was also involved :)

@TomDLT TomDLT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment thread sklearn/datasets/tests/test_common.py Outdated
)
def test_common_check_as_frame(name, dataset_func):
bunch = dataset_func()
check_as_frame(bunch, partial(dataset_func))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am curious, what is the use of partial here ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right it does not seem to be useful. I'll remove it

@adrinjalali adrinjalali left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!



def _has_network():
return bool(os.environ.get("SKLEARN_SKIP_NETWORK_TESTS", False))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

related: #17553 by @thomasjpfan

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure if you wanna merge as is or take that PR into account.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ideally, I would have like to merge it quickly to avoid redundant tests in the fetch_* PRs that are coming. I also want the PR of @thomasjpfan to get in because this is really useful but I think that the fix will be easy to handle even once merged.

@adrinjalali
adrinjalali merged commit 129588c into scikit-learn:master Jun 16, 2020
rubywerman pushed a commit to MLH-Fellowship/scikit-learn that referenced this pull request Jun 24, 2020
* MNT refactor tests for datasets

* PEP8

* remove partial
viclafargue pushed a commit to viclafargue/scikit-learn that referenced this pull request Jun 26, 2020
* MNT refactor tests for datasets

* PEP8

* remove partial
jayzed82 pushed a commit to jayzed82/scikit-learn that referenced this pull request Oct 22, 2020
* MNT refactor tests for datasets

* PEP8

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants