The Wayback Machine - https://web.archive.org/web/20201012120621/https://github.com/pandas-dev/pandas/issues/36745
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

DOC: TimeStamp.strftime() missing argument description #36745

Open
Dr-Irv opened this issue Sep 30, 2020 · 5 comments
Open

DOC: TimeStamp.strftime() missing argument description #36745

Dr-Irv opened this issue Sep 30, 2020 · 5 comments

Comments

@Dr-Irv
Copy link
Contributor

@Dr-Irv Dr-Irv commented Sep 30, 2020

Location of the documentation

https://pandas.pydata.org/docs/dev/reference/api/pandas.Timestamp.strftime.html?highlight=strftime#pandas.Timestamp.strftime

Documentation problem

The argument for TimeStamp.strftime() is missing in the docs

Suggested fix for documentation

Argument is a format string. Should reference python docs https://docs.python.org/3/library/datetime.html

@TomAugspurger
Copy link
Contributor

@TomAugspurger TomAugspurger commented Sep 30, 2020

I think this is a CPython issue. We subclass datetime.datetime, and don't override strftime.

In [9]: pd.Timestamp.strftime is datetime.datetime.strftime
Out[9]: True
@Dr-Irv
Copy link
Contributor Author

@Dr-Irv Dr-Irv commented Sep 30, 2020

@TomAugspurger So how does the doc page for Timestamp.strftime() get generated?

@jorisvandenbossche
Copy link
Member

@jorisvandenbossche jorisvandenbossche commented Sep 30, 2020

So how does the doc page for Timestamp.strftime() get generated?

The docstring is inherited as well, so pd.Timestamp.strftime.__doc__ is the docstring of the stdlib (which is not very informative).

We could override the method just to add a more elaborate docstring.

@Dr-Irv
Copy link
Contributor Author

@Dr-Irv Dr-Irv commented Sep 30, 2020

I think we'd have to also make sure it picks up the parameter correctly. If you look at the current doc, it doesn't indicate that format is a parameter to Timestamp.strftime() .

Is this possibly an issue with how the methods for datetime.datetime are picked up when we build the docs for Timestamp, and when this happens, we aren't picking up the parameters correctly?

@jorisvandenbossche
Copy link
Member

@jorisvandenbossche jorisvandenbossche commented Sep 30, 2020

That's again still an issue with datetime.datetime, which simply has no information about its arguments (eg inspecting the signature of it will fail), and which we inherit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.