Skip to content

TST: suppress deprecation messages in doc tests for Index.is_foo #51212

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

Merged
merged 2 commits into from
Feb 8, 2023

Conversation

topper-123
Copy link
Contributor

@topper-123 topper-123 commented Feb 7, 2023

There were a lot of deprecation messages shown when running ci/code_checks.sh docstrings.

This suppresses those messages.

Example of messages that are now suppressed:

<doctest pandas.Index.is_boolean[1]>:1: FutureWarning: Index.is_boolean is deprecated. Use pandas.api.types.is_bool_type instead.
  idx.is_boolean()
<doctest pandas.Index.is_categorical[1]>:1: FutureWarning: CategoricalIndex.is_categorical is deprecated.Use pandas.api.types.is_categorical_dtype instead
  idx.is_categorical()
<doctest pandas.Index.is_categorical[3]>:1: FutureWarning: Index.is_categorical is deprecated.Use pandas.api.types.is_categorical_dtype instead
  idx.is_categorical()
<doctest pandas.Index.is_categorical[6]>:1: FutureWarning: RangeIndex.is_categorical is deprecated.Use pandas.api.types.is_categorical_dtype instead
  s.index.is_categorical()

xref #50042.

@topper-123 topper-123 changed the title TST: suppress deprecation messages in doc tests in Index.is_* TST: suppress deprecation messages in doc tests for Index.is_foo Feb 7, 2023
@mroeschke
Copy link
Member

Does this fix all the warnings when validating docstrings? #44642

If so, we might want to errors on warnings

@mroeschke mroeschke added the Docs label Feb 7, 2023
@topper-123
Copy link
Contributor Author

You’re talking about making ci/code_checks.sh docstringsfail when a warning is raised? This diesn’t do that, this is only about the ones that were caused directly by #50042.

@mroeschke mroeschke added this to the 2.0 milestone Feb 8, 2023
@mroeschke mroeschke merged commit 0170fa0 into pandas-dev:main Feb 8, 2023
@mroeschke
Copy link
Member

Thanks @topper-123

@topper-123 topper-123 deleted the Index.is_foo_deprecation_docs branch February 8, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants