-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: fix AttributeError raised with pd.concat between a None and timezone-aware Timestamp #54428
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
Changes from 11 commits
d75762d
e17bd97
8804de4
c1c5675
634e522
4171a7c
11db8f1
416f4a8
8363a47
71788fd
b902ade
f3ddec2
2c9e3f5
57dfdc5
dc073e9
d13d27c
7f3d494
287bee1
4b5e247
b9e4c8b
4e76bbb
e5ae627
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
BlockPlacement, | ||
BlockValuesRefs, | ||
) | ||
from pandas._libs.tslibs import Timestamp | ||
from pandas.errors import PerformanceWarning | ||
from pandas.util._decorators import cache_readonly | ||
from pandas.util._exceptions import find_stack_level | ||
|
@@ -2274,7 +2275,7 @@ def _preprocess_slice_or_indexer( | |
def make_na_array(dtype: DtypeObj, shape: Shape, fill_value) -> ArrayLike: | ||
if isinstance(dtype, DatetimeTZDtype): | ||
# NB: exclude e.g. pyarrow[dt64tz] dtypes | ||
i8values = np.full(shape, fill_value._value) | ||
i8values = np.full(shape, Timestamp(fill_value)._value) | ||
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. we need to be sure that the Timestamp here has the same unit as the dtype 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. I added the unit. Is this function only for NA fill_value? Then it seems unit has no effect since NaT does not have unit. 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. Its always NA for concat, but we can get here with non-NA via reindex with fill_vlaue |
||
return DatetimeArray(i8values, dtype=dtype) | ||
|
||
elif is_1d_only_ea_dtype(dtype): | ||
|
Uh oh!
There was an error while loading. Please reload this page.