-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
Review inplace parameter #58
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generally looks good, but you have a testing failure. Thanks for including those tests along with the stub changes.
For each of the new tests you added, can you add a reference to the GH issue, via a comment like this:
def test_types_replace() -> None:
# GH 44
s = pd.Series([1, 2, 3])
res1: pd.Series = s.replace(1, 2)
res2: pd.Series = s.replace(1, 2, inplace=False)
res3: None = s.replace(1, 2, inplace=True)
tests/test_frame.py
Outdated
s1 = pd.DataFrame([[1, 2, 3]]) | ||
s2: pd.DataFrame = s1.ffill() | ||
s3: pd.DataFrame = s1.ffill(inplace=False) | ||
s4: None = s1.DataFrame(inplace=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is failing here. Should be pd.DataFrame
Fixed failing test.
Not sure I understand the benefit. The issue doesn't add anything useful to understanding the test; the test performs basic coverage of the methods. |
tests/test_series.py
Outdated
res1: pd.Series = s.sort_index() | ||
res2: pd.Series = s.sort_index(ascending=False) | ||
res3: None = s.sort_index(ascending=False, inplace=True) | ||
res4: pd.Series = s.sort_index(kind="mergesort") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know most tests do not yet use typing_extensions.assert_type
. If you want, you could re-write these new tests to use assert_type(s.sort_index(), pd.Series)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
It allows us to track why we added the test, in case something comes up in the future. It's a standard practice we use in the |
done |
Thanks @crusaderky |
Closes #44