Skip to content

Commit da3e0d1

Browse files
committed
TST: dtype fixes on windows for #10322, #10308
1 parent 07ea11c commit da3e0d1

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

pandas/io/tests/test_json/test_pandas.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
cat = ['bah']*5 + ['bar']*5 + ['baz']*5 + ['foo']*(len(_cat_frame)-15)
2828
_cat_frame.index = pd.CategoricalIndex(cat,name='E')
2929
_cat_frame['E'] = list(reversed(cat))
30-
_cat_frame['sort'] = np.arange(len(_cat_frame))
30+
_cat_frame['sort'] = np.arange(len(_cat_frame),dtype='int64')
3131

3232
_mixed_frame = _frame.copy()
3333

pandas/src/ujson/python/objToJSON.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,7 @@ void Object_beginTypeContext (JSOBJ _obj, JSONTypeContext *tc)
20822082
return;
20832083
}
20842084

2085-
PyObject* getValuesFunc = PyObject_GetAttrString(obj, "get_values");
2085+
getValuesFunc = PyObject_GetAttrString(obj, "get_values");
20862086
if (getValuesFunc)
20872087
{
20882088
PRINTMARK();

pandas/tests/test_indexing.py

+12-8
Original file line numberDiff line numberDiff line change
@@ -2331,25 +2331,29 @@ def test_setitem_dtype_upcast(self):
23312331
assert_frame_equal(df,expected)
23322332

23332333
# GH10280
2334-
df = DataFrame(np.arange(6).reshape(2, 3), index=list('ab'),
2335-
columns=['foo', 'bar', 'baz'])
2334+
df = DataFrame(np.arange(6,dtype='int64').reshape(2, 3),
2335+
index=list('ab'),
2336+
columns=['foo', 'bar', 'baz'])
23362337

23372338
for val in [3.14, 'wxyz']:
23382339
left = df.copy()
23392340
left.loc['a', 'bar'] = val
2340-
right = DataFrame([[0, val, 2], [3, 4, 5]], index=list('ab'),
2341-
columns=['foo', 'bar', 'baz'])
2341+
right = DataFrame([[0, val, 2], [3, 4, 5]],
2342+
index=list('ab'),
2343+
columns=['foo', 'bar', 'baz'])
23422344

23432345
assert_frame_equal(left, right)
23442346
self.assertTrue(com.is_integer_dtype(left['foo']))
23452347
self.assertTrue(com.is_integer_dtype(left['baz']))
23462348

2347-
left = DataFrame(np.arange(6).reshape(2, 3) / 10.0, index=list('ab'),
2348-
columns=['foo', 'bar', 'baz'])
2349+
left = DataFrame(np.arange(6,dtype='int64').reshape(2, 3) / 10.0,
2350+
index=list('ab'),
2351+
columns=['foo', 'bar', 'baz'])
23492352
left.loc['a', 'bar'] = 'wxyz'
23502353

2351-
right = DataFrame([[0, 'wxyz', .2], [.3, .4, .5]], index=list('ab'),
2352-
columns=['foo', 'bar', 'baz'])
2354+
right = DataFrame([[0, 'wxyz', .2], [.3, .4, .5]],
2355+
index=list('ab'),
2356+
columns=['foo', 'bar', 'baz'])
23532357

23542358
assert_frame_equal(left, right)
23552359
self.assertTrue(com.is_float_dtype(left['foo']))

0 commit comments

Comments
 (0)