-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
Bug fix - extension array with 2d datetime64 #46140
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
Closed
weikhor wants to merge 29 commits into pandas-dev:main from weikhor:bug_ExtensionArray_with_2D_datetime64
Closed
Changes from 1 commit
Commits
Show all changes
29 commits Select commit Hold shift + click to select a range
e46c85f Update format.py
0a51d25 Update test_format.py
c6bf639 pre commit
f857db8 Update test_format.py
2be9fd2 incompatible types in assignment
c368578 Merge branch 'bug_ExtensionArray_with_2D_datetime64' of https://githu…
d286682 add
6eea976 Update astype.py
3875560 Incompatible return value type
00a7e7e change to list(fmt_values)
065001f add
654b01a add
55f4908 add
fed0694 Update test_format.py
a77eb63 add ndim condition
5c6370e Merge branch 'main' into bug_ExtensionArray_with_2D_datetime64
54e1316 2d case
e24e05d Merge branch 'bug_ExtensionArray_with_2D_datetime64' of https://githu…
7fed730 change numpy type
75e6228 Merge branch 'main' into bug_ExtensionArray_with_2D_datetime64
a8c3b46 Merge branch 'main' into bug_ExtensionArray_with_2D_datetime64
dee7364 tidy
3d7556b Merge branch 'main' into bug_ExtensionArray_with_2D_datetime64
8100431 Merge branch 'main' into bug_ExtensionArray_with_2D_datetime64
95b423d nested format
7451562 expression and variable
f71e11f Update format.py
d927e42 Merge branch 'main' into bug_ExtensionArray_with_2D_datetime64
7e5739b Merge branch 'main' into bug_ExtensionArray_with_2D_datetime64
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
add
- Loading branch information
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -1628,13 +1628,13 @@ def _format_strings(self) -> list[str]: | |
| values = DatetimeIndex(values) | ||
| | ||
| if self.formatter is not None and callable(self.formatter): | ||
| fmt_values = np.frompyfunc(self.formatter, 1, 1)(values) | ||
| fmt_values = [self.formatter(x) for x in values] | ||
| else: | ||
| fmt_values = values._data._format_native_types( | ||
| na_rep=self.nat_rep, date_format=self.date_format | ||
| ) | ||
| | ||
| nested_formatter = GenericArrayFormatter(fmt_values) | ||
| nested_formatter = GenericArrayFormatter(np.array(fmt_values)) | ||
| fmt_values = nested_formatter.get_result() | ||
| return list(fmt_values) | ||
| Member 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. why is anything necessary between L1630-L1640? we know we have DatetimeIndex which is 1D. | ||
| | ||
| | ||
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
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.
OK, so there is a deeper bug here in that DatetimeIndex(values) isn't raising when passed a 2D array.