Skip to content

TST: annotations, fix test_invert #54576

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 8 commits into from
Aug 17, 2023
Merged

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

expected = pd.Series(~data, name="name")
tm.assert_series_equal(result, expected)
try:
[~x for x in data]
Copy link
Member

Choose a reason for hiding this comment

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

Maybe for x in data.unique(): ~x so we process and minimize collecting values.

Also should the data.dtype.na_value be skipped when trying invert?

Copy link
Member Author

Choose a reason for hiding this comment

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

ill just make it data[:10]. if ~na_value raises im not sure what id expect ~data to do, so prefer to leave that as is

@mroeschke mroeschke added Testing pandas testing functions or related to the test suite ExtensionArray Extending pandas with custom dtypes or arrays. labels Aug 16, 2023
@mroeschke mroeschke added this to the 2.2 milestone Aug 16, 2023
@@ -18,6 +18,7 @@

from pandas.core.dtypes.dtypes import IntervalDtype

import pandas as pd
Copy link
Member

Choose a reason for hiding this comment

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

Good to put in if TYPE_CHECKING?

@mroeschke mroeschke merged commit 4efc97c into pandas-dev:main Aug 17, 2023
@mroeschke
Copy link
Member

Thanks @jbrockmendel

mroeschke pushed a commit to mroeschke/pandas that referenced this pull request Aug 18, 2023
* TST: annotations, fix test_invert

* mypy fixup

* trim runtime

* use TYPE_CHECKING

* xfail fixed
@jbrockmendel jbrockmendel deleted the ref-tsts-2 branch August 21, 2023 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays. Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants