Skip to content

TST: Don't use deprecated version of read_html#33482

Merged
jreback merged 1 commit into
pandas-dev:masterfrom
LTe:remove-warning-keyword-arguments
Apr 12, 2020
Merged

TST: Don't use deprecated version of read_html#33482
jreback merged 1 commit into
pandas-dev:masterfrom
LTe:remove-warning-keyword-arguments

Conversation

@LTe

@LTe LTe commented Apr 11, 2020

Copy link
Copy Markdown
Contributor

Usage of function read_html is marked as deprecated when used with
positional arguments. In case when we do not explicitly check the
warning message with assert_produces_warning we should use non-deprecated
version.

This will resolve #33397

To identify candidates to change I modified decorator to raise an Exception

--- a/pandas/util/_decorators.py
+++ b/pandas/util/_decorators.py
@@ -294,6 +294,7 @@ def deprecate_nonkeyword_arguments(
                     "Starting with Pandas version {version} all arguments of {funcname}"
                     "{except_args} will be keyword-only"
                 ).format(version=version, funcname=func.__name__, except_args=arguments)
+                raise Exception("keyword argument test")
                 warnings.warn(msg, FutureWarning, stacklevel=stacklevel)
             return func(*args, **kwargs)

Related test build https://dev.azure.com/piotrnielacny/piotrnielacny/_build/results?buildId=2&view=ms.vss-test-web.build-test-results-tab

Usage of function read_html is marked as deprecated when used with
positional arguments. In case when we do not explicitly check the
warning message with assert_produces_warning we should use non-deprecated
version.

This will resolve pandas-dev#33397
@LTe LTe force-pushed the remove-warning-keyword-arguments branch from c5b9942 to 9d745c8 Compare April 11, 2020 14:36
@LTe LTe changed the title TST: Don't use eprecated version of read_html TST: Don't use deprecated version of read_html Apr 11, 2020
@topper-123 topper-123 added the Testing pandas testing functions or related to the test suite label Apr 11, 2020
@topper-123 topper-123 added this to the 1.1 milestone Apr 11, 2020
@alimcmaster1

Copy link
Copy Markdown
Member

LGTM - @LTe can you put an x in the closes checkbox so the issue is closed when merged

@LTe

LTe commented Apr 12, 2020

Copy link
Copy Markdown
Contributor Author

@alimcmaster1 checked

@alimcmaster1

Copy link
Copy Markdown
Member

cc @TomAugspurger

@jreback jreback merged commit 9e8ccd7 into pandas-dev:master Apr 12, 2020
@jreback

jreback commented Apr 12, 2020

Copy link
Copy Markdown
Contributor

thanks @LTe

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

Labels

Testing pandas testing functions or related to the test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: pandas warnings in tests about keyword only arguments

4 participants