Skip to content
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

Merged
merged 5 commits into from
Jul 1, 2022
Merged

Conversation

crusaderky
Copy link
Contributor

Closes #44

@crusaderky crusaderky changed the title Review inplace param Review inplace parameter Jul 1, 2022
@crusaderky crusaderky marked this pull request as ready for review July 1, 2022 12:29
Copy link
Collaborator

@Dr-Irv Dr-Irv left a 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)

s1 = pd.DataFrame([[1, 2, 3]])
s2: pd.DataFrame = s1.ffill()
s3: pd.DataFrame = s1.ffill(inplace=False)
s4: None = s1.DataFrame(inplace=True)
Copy link
Collaborator

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

@crusaderky
Copy link
Contributor Author

Fixed failing test.

For each of the new tests you added, can you add a reference to the GH issue

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.

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")
Copy link
Member

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Jul 1, 2022

Fixed failing test.

For each of the new tests you added, can you add a reference to the GH issue

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.

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 pandas project.

@crusaderky
Copy link
Contributor Author

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 pandas project.

done

@Dr-Irv Dr-Irv merged commit 7a5d7a8 into pandas-dev:main Jul 1, 2022
@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Jul 1, 2022

Thanks @crusaderky

@crusaderky crusaderky deleted the ffill_inplace branch July 1, 2022 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inplace argument should be optional in ffill() and bfill()
3 participants