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

TYP: Allow None in Period.strftime #55190

Merged
merged 3 commits into from
Sep 19, 2023

Conversation

rhshadrach
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • 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.

Fixes the ASV failures in the first two lines of: #55179 (comment)

While not familiar with this code, I believe this is the correct resolution because (a) of the ASV tslibs.period.PeriodUnaryMethods.time_strftime_default explicitly passes None and (b) the fmt argument is passed to period_format which has the signature object fmt=None.

@rhshadrach rhshadrach added the Typing type annotations, mypy/pyright type checking label Sep 18, 2023
@twoertwein
Copy link
Member

It might be nice to mention in the doc-string what None does.

@rhshadrach
Copy link
Member Author

@twoertwein - done.

@rhshadrach rhshadrach added Docs Period Period data type labels Sep 19, 2023
@rhshadrach rhshadrach added this to the 2.2 milestone Sep 19, 2023
@mroeschke mroeschke merged commit 696d21b into pandas-dev:main Sep 19, 2023
41 checks passed
@mroeschke
Copy link
Member

Thanks @rhshadrach

@rhshadrach rhshadrach deleted the period_strftime_typehint branch September 19, 2023 20:33
hedeershowk pushed a commit to hedeershowk/pandas that referenced this pull request Sep 20, 2023
* TYP: Allow None in strftime

* Change pyi

* Add description to docstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Period Period data type Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants