Skip to content

Conversation

@sjalkote
Copy link
Contributor

@sjalkote sjalkote commented Mar 16, 2024

Picked up issue #49202. This adds examples for creating index, dataframe, and series accessors.

@sjalkote
Copy link
Contributor Author

pre-commit.ci autofix

@sjalkote
Copy link
Contributor Author

pre-commit.ci autofix

Copy link
Contributor

@s1099 s1099 left a comment

Choose a reason for hiding this comment

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

remove double newline

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Appender is something that we used before doc existed, but I think it'd be better to not use, as makes things more difficult to understand. I think you're adding the examples to all register accessor functions, so you can add the Examples header to the main docstring, and then add a variable for the content of the section as it's done with {klass}.

Unrelated, in the examples section is not needed to create a code-block. You can just start the code with >>> and the docstring parser should understand it's code. Also, it's not needed to import pandas, pd should already be available without importing.

@sjalkote
Copy link
Contributor Author

pre-commit.ci autofix

@sjalkote sjalkote requested a review from datapythonista March 17, 2024 22:05
@datapythonista
Copy link
Member

Can you have a look at the CI errors please?

sjalkote and others added 2 commits March 19, 2024 10:07
Co-authored-by: s1099 <46890315+s1099@users.noreply.github.com>
Co-authored-by: s1099 <46890315+s1099@users.noreply.github.com>
@Aloqeely
Copy link
Member

The checks are still failing, could you please fix them?

@sjalkote sjalkote requested a review from mroeschke as a code owner April 1, 2024 22:49
@sjalkote
Copy link
Contributor Author

sjalkote commented Apr 2, 2024

Hi @datapythonista I believe we have fixed all the CI errors. Could you please re-review?

@sjalkote sjalkote requested a review from mroeschke April 3, 2024 00:04
@mroeschke
Copy link
Member

/preview

@github-actions
Copy link
Contributor

github-actions bot commented Apr 3, 2024

Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/57867/

@mroeschke mroeschke added this to the 3.0 milestone Apr 3, 2024
@mroeschke mroeschke merged commit 308b773 into pandas-dev:main Apr 3, 2024
@mroeschke
Copy link
Member

Thanks @sjalkote

pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
* DOC: Add examples for creating an index accessor * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix E501 lint errors * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix failing CI builds for Docstring * fix newline * Remove redundant code-block directives * Use variables for `Examples` content * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix docstring validation errors Co-authored-by: s1099 <46890315+s1099@users.noreply.github.com> * Fix docstring validation errors Co-authored-by: s1099 <46890315+s1099@users.noreply.github.com> * Fix CI errors * Fix CI errors * Fix CI errors * Fix CI errors * Fix CI errors (again lol) * Undo validation ignore for docstrings --------- Co-authored-by: TechnoShip123 <75491816+TechnoShip123@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: s1099 <46890315+s1099@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 participants