Skip to content

Commit 6f844e1

Browse files
committed
extend tests rebuild and retest
1 parent fc574eb commit 6f844e1

File tree

4 files changed

+5
-58
lines changed

4 files changed

+5
-58
lines changed

coverage.txt

Lines changed: 3 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ tests/test_get_methods_used.py . [ 30%]
4747
tests/test_ghost_col_issue.py . [ 31%]
4848
tests/test_idioms.py ................. [ 37%]
4949
tests/test_if_else.py ..... [ 39%]
50-
tests/test_if_else_return_type.py F [ 39%]
50+
tests/test_if_else_return_type.py . [ 39%]
5151
tests/test_incomplete_agg.py . [ 39%]
5252
tests/test_join_check.py . [ 40%]
5353
tests/test_join_effects.py . [ 40%]
@@ -117,58 +117,6 @@ tests/test_window_fns.py ..... [ 98%]
117117
tests/test_with.py .. [ 99%]
118118
tests/test_xicor.py .. [100%]
119119

120-
=================================== FAILURES ===================================
121-
___________________________ test_if_else_return_type ___________________________
122-
123-
def test_if_else_return_type():
124-
pd = data_algebra.default_data_model.pd
125-
d = pd.DataFrame({
126-
'x': [True, False, None],
127-
})
128-
ops = (
129-
descr(d=d)
130-
.extend({
131-
'w': 'x.where(1.0, 2.0)',
132-
'i': 'x.if_else(1.0, 2.0)',
133-
})
134-
)
135-
res = ops.transform(d)
136-
expect = pd.DataFrame({
137-
'x': [True, False, None],
138-
'w': [1.0, 2.0, 2.0],
139-
'i': [1.0, 2.0, numpy.nan],
140-
})
141-
assert data_algebra.test_util.equivalent_frames(res, expect)
142-
assert str(res['w'].dtype) == 'float64'
143-
assert str(res['i'].dtype) == 'float64'
144-
> numpy.isnan(res) # when column types are wrong this threw in pyvteat test_KDD2009.py
145-
146-
tests/test_if_else_return_type.py:31:
147-
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
148-
../../../opt/anaconda3/envs/ai_academy_3_9/lib/python3.9/site-packages/pandas/core/generic.py:2032: in __array_ufunc__
149-
return arraylike.array_ufunc(self, ufunc, method, *inputs, **kwargs)
150-
../../../opt/anaconda3/envs/ai_academy_3_9/lib/python3.9/site-packages/pandas/core/arraylike.py:372: in array_ufunc
151-
result = mgr.apply(getattr(ufunc, method))
152-
../../../opt/anaconda3/envs/ai_academy_3_9/lib/python3.9/site-packages/pandas/core/internals/managers.py:325: in apply
153-
applied = b.apply(f, **kwargs)
154-
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
155-
156-
self = ObjectBlock: slice(0, 1, 1), 1 x 3, dtype: object
157-
func = <method-wrapper '__call__' of numpy.ufunc object at 0x7fb3f81ee7c0>
158-
kwargs = {}
159-
160-
@final
161-
def apply(self, func, **kwargs) -> list[Block]:
162-
"""
163-
apply the function to my values; return a block if we are not
164-
one
165-
"""
166-
with np.errstate(all="ignore"):
167-
> result = func(self.values, **kwargs)
168-
E TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
169-
170-
../../../opt/anaconda3/envs/ai_academy_3_9/lib/python3.9/site-packages/pandas/core/internals/blocks.py:382: TypeError
171-
172120
---------- coverage: platform darwin, python 3.9.7-final-0 -----------
173121
Name Stmts Miss Cover Missing
174122
--------------------------------------------------------------------
@@ -204,6 +152,5 @@ data_algebra/util.py 140 29 79% 26, 51, 56, 61, 84-
204152
--------------------------------------------------------------------
205153
TOTAL 5669 712 87%
206154

207-
=========================== short test summary info ============================
208-
FAILED tests/test_if_else_return_type.py::test_if_else_return_type - TypeErro...
209-
================== 1 failed, 281 passed in 406.07s (0:06:46) ===================
155+
156+
======================= 282 passed in 485.89s (0:08:05) ========================
0 Bytes
Binary file not shown.

dist/data_algebra-1.3.1.tar.gz

0 Bytes
Binary file not shown.

tests/test_if_else_return_type.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ def test_if_else_return_type():
2828
assert data_algebra.test_util.equivalent_frames(res, expect)
2929
assert str(res['w'].dtype) == 'float64'
3030
assert str(res['i'].dtype) == 'float64'
31-
numpy.isnan(res) # when column types are wrong this threw in pyvteat test_KDD2009.py
31+
numpy.isnan(res.loc[:, ['w', 'i']]) # when column types are wrong this threw in pyvteat test_KDD2009.py
3232
sqlite_handle = data_algebra.SQLite.example_handle()
3333
sqlite_handle.insert_table(d, table_name='d', allow_overwrite=True)
3434
res_sqlite = sqlite_handle.read_query(ops)
3535
sqlite_handle.close()
3636
assert data_algebra.test_util.equivalent_frames(res_sqlite, expect)
3737
assert str(res_sqlite['w'].dtype) == 'float64'
3838
assert str(res_sqlite['i'].dtype) == 'float64'
39-
numpy.isnan(res_sqlite) # when column types are wrong this threw in pyvteat test_KDD2009.py
39+
numpy.isnan(res_sqlite.loc[:, ['w', 'i']]) # when column types are wrong this threw in pyvteat test_KDD2009.py

0 commit comments

Comments
 (0)