Skip to content

DOC: Additions to month_name & day_name #51154

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

Merged
merged 8 commits into from
Feb 8, 2023
Merged

DOC: Additions to month_name & day_name #51154

merged 8 commits into from
Feb 8, 2023

Conversation

eduardochaves1
Copy link
Contributor

@eduardochaves1 eduardochaves1 commented Feb 4, 2023

In the issue #51138 I was trying to set a column in my DF for the month and day's names in portuguese, then a good guy told me about the locale -a command from terminal to look for the right way to set the locale string parameter for my code to work properly.

So I thought I would be nice if the respective docs, month_name & day_name, had these informations for the user to know about.

So I added these infos plus a quick example for each method in the docstrings from /pandas/core/arrays/datetimes.py

PS.: I just don't know why the validade_docstrings.py don't recognize the changes I made in the method's docstring...

Output: validate_docstrings.py pandas.Series.dt.month_name

Screenshot from 2023-02-03 21-02-04

Output: validate_docstrings.py pandas.Series.dt.day_name

Screenshot from 2023-02-03 21-00-58

Output: pre-commit run --files pandas/core/arrays/datetimes.py

Screenshot from 2023-02-03 22-11-09

@eduardochaves1
Copy link
Contributor Author

The CI is getting a UNEXPECTED EXCEPTION: Error('unsupported locale setting') error for my example with locale='pt_BR.utf8'. And I don't know exactly why, cause I tried the exact same code on my machine and it worked. Maybe this locale isn't installed on the machine in which does the CI.

@mroeschke
Copy link
Member

You will probably need to add # doctest: +SKIP to the example due to the locale being unavailable

@eduardochaves1
Copy link
Contributor Author

You will probably need to add # doctest: +SKIP to the example due to the locale being unavailable

I added it in the same line where the function was called with locate='pt_BR.utf8 (for both month_name & day_name) and the CI went well.

@mroeschke mroeschke added this to the 2.0 milestone Feb 8, 2023
@mroeschke mroeschke added the Docs label Feb 8, 2023
@mroeschke mroeschke merged commit fae47ff into pandas-dev:main Feb 8, 2023
@mroeschke
Copy link
Member

Thanks @eduardochaves1

@eduardochaves1 eduardochaves1 deleted the improve-datetimes-doc branch February 8, 2023 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: dt.month_name & dt.day_name locale parameter needs improvment
2 participants