-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
BUG: Fix Timestamp type checks to work with subclassed datetime (#25851) #25853
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
jreback merged 31 commits into pandas-dev:master from ArtificialQualia:update_timestamp_checks Apr 5, 2019
Merged
Changes from 27 commits
Commits
Show all changes
31 commits Select commit Hold shift + click to select a range
2e5a160 BUG: Fix Timestamp type checks to work with subclassed datetime (#25851)
ArtificialQualia 82b2420 increase spacing in comment
ArtificialQualia 4447746 fix spacing
ArtificialQualia 2d20375 fix import formatting
ArtificialQualia 8e8d816 move _Timestamp to separate file to prevent circular import
ArtificialQualia 4fd35ac fix indenting
ArtificialQualia 354d3a3 fix line spacing
ArtificialQualia 600be4f kickoff new build
ArtificialQualia 7a60942 updates for PR review
ArtificialQualia dd5d492 Merge branch 'master' into update_timestamp_checks
ArtificialQualia 46f306d fix isort error
ArtificialQualia 7268a91 Merge branch 'update_timestamp_checks' of https://github.com/Artifici…
ArtificialQualia ff0ddef fix isort error
ArtificialQualia c54ee53 force rebuild
ArtificialQualia 6dc805b PR updates
ArtificialQualia 789e121 Merge branch 'master' into update_timestamp_checks
ArtificialQualia 6a66238 parameterize test
ArtificialQualia 12a53be Merge branch 'update_timestamp_checks' of https://github.com/Artifici…
ArtificialQualia 7da7684 PR updates
ArtificialQualia dc0f806 fix namespace test for new api
ArtificialQualia 0cad612 fix typo
ArtificialQualia a1cb913 Merge branch 'master' into update_timestamp_checks
ArtificialQualia ee9d2d5 merge changes into _timestamp
ArtificialQualia 560ef6f change _timestamp files to c_timestamp
ArtificialQualia 92a9c52 Merge branch 'master' into update_timestamp_checks
ArtificialQualia b87aa99 use new tzconversion.tz_convert_single merged function
ArtificialQualia 11a091a move imports to fix import exceptions
ArtificialQualia 4896568 change imports
ArtificialQualia 43ec600 fix api test
ArtificialQualia 9795807 force rebuild
ArtificialQualia ded5e69 force rebuild
ArtificialQualia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # -*- coding: utf-8 -*- | ||
| | ||
| from cpython.datetime cimport datetime | ||
| | ||
| from numpy cimport int64_t | ||
| | ||
| cdef class _Timestamp(datetime): | ||
| cdef readonly: | ||
| int64_t value, nanosecond | ||
| object freq | ||
| list _date_attributes | ||
| cpdef bint _get_start_end_field(self, str field) | ||
| Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. future PR we should rename the 'private' functions to public if they are actually exposed (the _ leading ones) | ||
| cpdef _get_date_name_field(self, object field, object locale) | ||
| cdef int64_t _maybe_convert_value_to_local(self) | ||
| cpdef to_datetime64(self) | ||
| cdef _assert_tzawareness_compat(_Timestamp self, datetime other) | ||
| cpdef datetime to_pydatetime(_Timestamp self, bint warn=*) | ||
| cdef bint _compare_outside_nanorange(_Timestamp self, datetime other, | ||
| int op) except -1 | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need this function here? this should not be exposed to the rest of the codebase (or directly imported if it actually is needed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe just expose it in timestamp.pyx itself to make it easier to import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was exposed previously, and is only used in
pandas/core/arrays/datetimelike.py._Timestampitself makes use of it, so it has to be inc_timestamp.pyxotherwise we would have a circular import.I can change the import in
datetimelike.pyto directly import it if you want.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry made the comment in the wrong place. yes just import it directly in
dateimelike.pyand don't put it intslibs/__init__.py