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

DEPR: Positional arguments in Series.to_string #57375

Merged
merged 9 commits into from
Feb 17, 2024
Merged

DEPR: Positional arguments in Series.to_string #57375

merged 9 commits into from
Feb 17, 2024

Conversation

rmhowe425
Copy link
Contributor

@rmhowe425 rmhowe425 commented Feb 12, 2024

@simonjayhawkins simonjayhawkins added IO Data IO issues that don't fit into a more specific label Deprecate Functionality to remove in pandas labels Feb 13, 2024
@rmhowe425
Copy link
Contributor Author

@mroeschke Pinging on green

@twoertwein
Copy link
Member

Looking good! You can already make the two overloads keyword-only, if you want to:

    @overload
    def to_string(
        self,
        buf: None = ...,
        *,
        na_rep: str = ...,

@rmhowe425
Copy link
Contributor Author

@twoertwein It looks like the two overloaded methods are already keyword only. Is there something specific I need to do?

@twoertwein
Copy link
Member

Is there something specific I need to do?

Just need to add two *,

    @overload
    def to_string(
        self,
        buf: None = ...,
       *,  # add this
        na_rep: str = ...,

    @overload
    def to_string(
        self,
        buf: FilePath | WriteBuffer[str],
       *, # add this
        na_rep: str = ...,

    @deprecate_nonkeyword_arguments(
    def to_string(

@rmhowe425
Copy link
Contributor Author

@twoertwein Pinging on green.

BTW I didn't know that you can use * to mandate the use of keyword args after the *. I learned something new today!

@twoertwein twoertwein merged commit 63dc0f7 into pandas-dev:main Feb 17, 2024
47 checks passed
@twoertwein
Copy link
Member

Thank you @rmhowe425 !

@rmhowe425 rmhowe425 deleted the dev/depr/str-literal-to-string branch February 17, 2024 17:14
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
* Adding deprecation, documentation, and unit test.

* Update series.py

* Updating unit tests.

* Updating implementation based on reviewer feedback.

* Updating implementation based on reviewer feedback.

* Updating implementation based on reviewer feedback.

* Updating implementation based on reviewer feedback.

* Updating implementation based on reviewer feedback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas IO Data IO issues that don't fit into a more specific label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DEPR: Positional arguments in Series.to_markdown/string
3 participants