Skip to content

Conversation

rmhowe425
Copy link
Contributor

@rmhowe425 rmhowe425 commented Feb 12, 2024

@rmhowe425 rmhowe425 changed the title DEPR: Positional arguments in Series.to_markdown/string DEPR: Positional arguments in Series.to_markdown 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

Looks good to me!

If you want to, you can also add overloads that already use the keyword-only syntax:

    @overload
    def to_markdown(
        self,
        buf: None = ...,
        *,
        mode: str = ...,
        index: bool = ...,
        storage_options: StorageOptions | None = ...,
        **kwargs,
    ) -> str: ...

    @overload
    def to_markdown(
        self,
        buf: IO[str],
        *,
        mode: str = ...,
        index: bool = ...,
        storage_options: StorageOptions | None = ...,
        **kwargs,
    ) -> None: ...

    @overload
    def to_markdown(
        self,
        buf: IO[str] | None,
        *,
        mode: str = ...,
        index: bool = ...,
        storage_options: StorageOptions | None = ...,
        **kwargs,
    ) -> str | None: ...

@twoertwein
Copy link
Member

The changes look good to me, but the doc-test is failing (@mroeschke). The doc-test should definitely succeed before merging as the typing tests run after the doc-tests (in case mypy/pyright pick up something).

@rmhowe425 rmhowe425 requested a review from twoertwein February 18, 2024 21:10
@twoertwein twoertwein merged commit 2ef7eb3 into pandas-dev:main Feb 18, 2024
@twoertwein
Copy link
Member

Thank you @rmhowe425 !

@rmhowe425 rmhowe425 deleted the dev/depr/Series-to-string branch February 18, 2024 22:00
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
* Updated whatsnew and added deprecation message.

* Adding unit test for deprecation warning.

* Updating unit tests.

* Update series.py

* Updating unit test and documentation.

* Adding in to_markdown overload functions per 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