Skip to content

Dont re-pin total_seconds as it is already implemented #17432

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 2 commits into from
Sep 7, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pandas/_libs/tslib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3892,8 +3892,9 @@ for field in fields:
_nat_methods = ['date', 'now', 'replace', 'to_pydatetime',
'today', 'round', 'floor', 'ceil', 'tz_convert',
'tz_localize']
_nan_methods = ['weekday', 'isoweekday', 'total_seconds']
_implemented_methods = ['to_datetime', 'to_datetime64', 'isoformat']
_nan_methods = ['weekday', 'isoweekday']
Copy link
Contributor

Choose a reason for hiding this comment

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

This blows away the doc-string. So I would rather leave this as-is and simply remove the total_seconds method from NaT class; accomplishing the same thing more in-line with current code.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair enough. I defaulted to leaving the def total_seconds in place because it had a GH issue attached to it. Can change, or can just pin on the correct docstring up where the method is defined.

Copy link
Contributor

Choose a reason for hiding this comment

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

see my comments, its would be faster just to make the change.

_implemented_methods = [
'to_datetime', 'to_datetime64', 'isoformat', 'total_seconds']
_implemented_methods.extend(_nat_methods)
_implemented_methods.extend(_nan_methods)

Expand Down