Skip to content

Add nanoseconds to timestamps stub file #50374

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 3 commits into from
Dec 27, 2022
Merged

Conversation

robsdedude
Copy link
Contributor

@robsdedude robsdedude commented Dec 21, 2022

I also found the documentation to be lacking. I had to try it out to determine if nanoseconds would be giving me all nanoseconds until the next full second or just until the next full microsecond (the latter is the case).

  • no issue exists to track this (probably small enough)
  • tests not applicable, I think
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature. As suggested by @phofl not needed

robsdedude and others added 2 commits December 21, 2022 14:12
I also found the documentation to be lacking. I had to try it out to determine if `nanoseconds` would be giving me all nanoseconds until the next full second or just until the next full microsecond (the latter is the case).
@@ -30,6 +30,7 @@ Bug fixes
- Bug in :meth:`.Styler.to_excel` leading to error when unrecognized ``border-style`` (e.g. ``"hair"``) provided to Excel writers (:issue:`48649`)
- Bug when chaining several :meth:`.Styler.concat` calls, only the last styler was concatenated (:issue:`49207`)
- Fixed bug when instantiating a :class:`DataFrame` subclass inheriting from ``typing.Generic`` that triggered a ``UserWarning`` on python 3.11 (:issue:`49649`)
- Typing: add :attr:`.Timestamp.nanosecond` to :class:`Timestamp`
Copy link
Member

Choose a reason for hiding this comment

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

This is only internal, we don't need a whatsnew for this

Copy link
Contributor Author

@robsdedude robsdedude Dec 21, 2022

Choose a reason for hiding this comment

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

On second thought 🤔 is it internal though? If users run a typechecker and have an #type: ignore comment everywhere they use the nanosecond property, they won't get informed that they can possibly remove those.

@mroeschke mroeschke added the Typing type annotations, mypy/pyright type checking label Dec 21, 2022
@mroeschke mroeschke added this to the 2.0 milestone Dec 27, 2022
@mroeschke mroeschke merged commit 18dd6fa into pandas-dev:main Dec 27, 2022
@mroeschke
Copy link
Member

Thanks @robsdedude

@robsdedude robsdedude deleted the patch-1 branch December 29, 2022 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants