File tree Expand file tree Collapse file tree 4 files changed +323
-453
lines changed Expand file tree Collapse file tree 4 files changed +323
-453
lines changed Original file line number Diff line number Diff line change 89
89
assert_timedelta_array_equal ,
90
90
raise_assert_detail ,
91
91
)
92
- from pandas ._testing .compat import get_dtype # noqa:F401
92
+ from pandas ._testing .compat import ( # noqa:F401
93
+ get_dtype ,
94
+ get_obj ,
95
+ )
93
96
from pandas ._testing .contexts import ( # noqa:F401
94
97
RNGContext ,
95
98
decompress_file ,
Original file line number Diff line number Diff line change @@ -11,3 +11,13 @@ def get_dtype(obj):
11
11
return obj .dtypes .iat [0 ]
12
12
else :
13
13
return obj .dtype
14
+
15
+
16
+ def get_obj (df : DataFrame , klass ):
17
+ """
18
+ For sharing tests using frame_or_series, either return the DataFrame
19
+ unchanged or return it's first column as a Series.
20
+ """
21
+ if klass is DataFrame :
22
+ return df
23
+ return df ._ixs (0 , axis = 1 )
You can’t perform that action at this time.
0 commit comments