REF: remove unused nat_rep parameter from datetime/timedelta formatters#65161
Draft
jbrockmendel wants to merge 1 commit intopandas-dev:mainfrom
Draft
REF: remove unused nat_rep parameter from datetime/timedelta formatters#65161jbrockmendel wants to merge 1 commit intopandas-dev:mainfrom
jbrockmendel wants to merge 1 commit intopandas-dev:mainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nat_repparameter from_Datetime64Formatter.__init__and_Timedelta64Formatter.__init__— it was never passed by callers (format_arraypassesna_repto the parent class, notnat_rep), so it always took its default"NaT"value. Hardcode"NaT"at the call sites instead.nat_rep→na_repin private helpers (_format_datetime64,_format_datetime64_dateonly,get_format_datetime64,get_format_timedelta64) for naming consistency._Timedelta64Formatter.__init__.Part of GH#55426.
🤖 Generated with Claude Code