Skip to content

REF: formats.format functions that should be DTA methods #55394

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 7 commits into from
Oct 4, 2023

Conversation

jbrockmendel
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.

@mroeschke mroeschke added Refactor Internal refactoring of code Output-Formatting __repr__ of pandas objects, to_string labels Oct 4, 2023
Comment on lines 740 to 744
if date_format is None:
ido = self._is_dates_only
if ido:
# Only dates and no timezone: provide a default format
date_format = "%Y-%m-%d"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if date_format is None:
ido = self._is_dates_only
if ido:
# Only dates and no timezone: provide a default format
date_format = "%Y-%m-%d"
if date_format is None and self._is_dates_only:
# Only dates and no timezone: provide a default format
date_format = "%Y-%m-%d"

Nit

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea, will update

Copy link
Member Author

Choose a reason for hiding this comment

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

#55405 implements this same method in the mixin class TimelikeOps. That is the better long-term location. Will update whichever PR goes in second.

@jbrockmendel
Copy link
Member Author

updated+green. this and #55405 are blockers for several in-progress branches.

@mroeschke mroeschke added this to the 2.2 milestone Oct 4, 2023
@mroeschke mroeschke merged commit d943c26 into pandas-dev:main Oct 4, 2023
@mroeschke
Copy link
Member

Thanks @jbrockmendel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Output-Formatting __repr__ of pandas objects, to_string Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants