Skip to content

REF: remove unused nat_rep parameter from datetime/timedelta formatters#65161

Draft
jbrockmendel wants to merge 1 commit intopandas-dev:mainfrom
jbrockmendel:ref-ea-formatting-1
Draft

REF: remove unused nat_rep parameter from datetime/timedelta formatters#65161
jbrockmendel wants to merge 1 commit intopandas-dev:mainfrom
jbrockmendel:ref-ea-formatting-1

Conversation

@jbrockmendel
Copy link
Copy Markdown
Member

Summary

  • Remove the unused nat_rep parameter from _Datetime64Formatter.__init__ and _Timedelta64Formatter.__init__ — it was never passed by callers (format_array passes na_rep to the parent class, not nat_rep), so it always took its default "NaT" value. Hardcode "NaT" at the call sites instead.
  • Rename nat_repna_rep in private helpers (_format_datetime64, _format_datetime64_dateonly, get_format_datetime64, get_format_timedelta64) for naming consistency.
  • Remove the TODO comment on _Timedelta64Formatter.__init__.

Part of GH#55426.

🤖 Generated with Claude Code

The nat_rep parameter on _Datetime64Formatter and _Timedelta64Formatter
was never passed by callers (format_array passes na_rep to the parent
class, not nat_rep to the subclass), so it always took its default "NaT"
value. Remove it and hardcode "NaT" at the call sites. Also rename
nat_rep to na_rep in the private helper functions for naming consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jbrockmendel jbrockmendel added the Refactor Internal refactoring of code label Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Internal refactoring of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant