Skip to content

Commit e02bd54

Browse files
committed
COMPAT: windows dtype compat w.r.t. GH9019
1 parent c0a79e1 commit e02bd54

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

pandas/core/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,7 @@ def _get_leaf_sorter(labels):
18611861

18621862
starts = np.hstack(([True], tic, [True])).nonzero()[0]
18631863
lab = com._ensure_int64(labels[-1])
1864-
return lib.get_level_sorter(lab, starts)
1864+
return lib.get_level_sorter(lab, com._ensure_int64(starts))
18651865

18661866
if isinstance(self, MultiIndex) and isinstance(other, MultiIndex):
18671867
raise TypeError('Join on level between two MultiIndex objects '

pandas/io/tests/test_json/test_pandas.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,10 @@ def test_timedelta(self):
612612
assert_frame_equal(
613613
frame, pd.read_json(frame.to_json()).apply(converter))
614614

615-
frame = DataFrame({'a': [timedelta(23), timedelta(seconds=5)],
615+
frame = DataFrame({'a': [timedelta(days=23), timedelta(seconds=5)],
616616
'b': [1, 2],
617617
'c': pd.date_range(start='20130101', periods=2)})
618+
618619
result = pd.read_json(frame.to_json(date_unit='ns'))
619620
result['a'] = pd.to_timedelta(result.a, unit='ns')
620621
result['c'] = pd.to_datetime(result.c)
@@ -623,11 +624,12 @@ def test_timedelta(self):
623624
def test_mixed_timedelta_datetime(self):
624625
frame = DataFrame({'a': [timedelta(23), pd.Timestamp('20130101')]},
625626
dtype=object)
626-
expected = pd.read_json(frame.to_json(date_unit='ns'),
627-
dtype={'a': 'int64'})
628-
assert_frame_equal(DataFrame({'a': [pd.Timedelta(frame.a[0]).value,
629-
pd.Timestamp(frame.a[1]).value]}),
630-
expected)
627+
628+
expected = DataFrame({'a': [pd.Timedelta(frame.a[0]).value,
629+
pd.Timestamp(frame.a[1]).value]})
630+
result = pd.read_json(frame.to_json(date_unit='ns'),
631+
dtype={'a': 'int64'})
632+
assert_frame_equal(result, expected)
631633

632634
def test_default_handler(self):
633635
value = object()

0 commit comments

Comments
 (0)