-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Improved docstring and return type hints for to_datetime
#42494
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
Conversation
Following pandas-dev#42244 , improved documentation about datetime parsing. See also pandas-dev#42229 (comment)
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
@jreback do you have any additional response to the above comment ? otherwise we can probably proceed with merging "as is" |
closing as stale, if you want to continue working, please ping. |
@jreback thanks for the ping. I made changes in my branch but I do not see them here - I guess that you'll have to open the PR to see them ? I tried to update the documentation of the "utc" parameter so that it is easier to understand. I added the link that @mroeschke suggested in here (rather than in a notes section, but I guess we could also do both). Tomorrow I'll try to add a few examples showing the subtelties explained in the utc parameter doc. |
Thanks @mroeschke ! I'll push a few doc mods again and let you know. |
- adding an extended summary with details, instead of putting all details in the arguments and outputs description. - Fixing return type hints to add the type hints for datetime.datetime scalars or array-like. - adding an explicit "raises" section - adding illustrative examples
@jreback and @mroeschke : all set. Instead of trying to squeeze a complex explanation in the arguments and outputs definitions, I rather created a proper extended summary. I also fixed the return type hints and added several examples. These examples show that the current behaviour is quite complex, but at least now users can see it :) . Let me know what you think |
to_datetime
to_datetime
Looks like the |
I also realize that I did not write an entry in what's new. I see in 1.1.0 what's new that "clarified documentation" can be inserted in the bugfix section (see https://pandas.pydata.org/docs/whatsnew/v1.1.0.html?highlight=clarified#missing), so added something similar, let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good! Off to @jreback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smarie looks ok to me, if you can remove the whatsnew new and ping on green
@smarie if you can update and merge master |
This reverts commit 70a7c8f.
Sorry for the delay @jreback @mroeschke . I updated the branch and removed the whats new entry. |
thanks @smarie if you can rebase one more time pls. also if you can go over the text again and be consistent about using backticks vs class refs (e.g. i think we prefer to use |
cc @mroeschke if comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after @jreback's comments about the rendering consistency. CI failure will probably be unrelated.
…, instead of the double backticks.
from the doc build:
|
Thanks, It seems that this is now fixed @jreback . I fixed as much as possible the various sphinx roles everywhere, using explicit |
The remaining error is "/home/runner/work/pandas/pandas/pandas/core/ops/array_ops.py so it seems unrelated |
thanks @smarie very nice! |
Thanks very much @jreback and @mroeschke for your patience and careful review. |
Improved (still not ideal) fix for #42229 (datetime parsing behaviour in case of multiple time offsets due to daylight-savings in timezones) following #42244
See also #42229 (comment)