File tree 3 files changed +6
-7
lines changed
3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
1
# TODO: Needs a better name; too many modules are already called "concat"
2
2
from collections import defaultdict
3
3
import copy
4
+ from typing import List
4
5
5
6
import numpy as np
6
7
@@ -419,13 +420,15 @@ def _get_empty_dtype_and_na(join_units):
419
420
raise AssertionError (msg )
420
421
421
422
422
- def _is_uniform_join_units (join_units ) -> bool :
423
+ def _is_uniform_join_units (join_units : List [ JoinUnit ] ) -> bool :
423
424
"""
424
425
Check if the join units consist of blocks of uniform type that can
425
426
be concatenated using Block.concat_same_type instead of the generic
426
427
_concatenate_join_units (which uses `concat_compat`).
427
428
428
429
"""
430
+ # TODO: require dtype match in addition to same type? e.g. DatetimeTZBlock
431
+ # cannot necessarily join
429
432
return (
430
433
# all blocks need to have the same type
431
434
all (type (ju .block ) is type (join_units [0 ].block ) for ju in join_units )
Original file line number Diff line number Diff line change 20
20
from pandas .core .dtypes .common import (
21
21
DT64NS_DTYPE ,
22
22
is_datetimelike_v_numeric ,
23
+ is_dtype_equal ,
23
24
is_extension_array_dtype ,
24
25
is_list_like ,
25
26
is_numeric_v_string_like ,
42
43
DatetimeTZBlock ,
43
44
ExtensionBlock ,
44
45
ObjectValuesExtensionBlock ,
46
+ _block_shape ,
45
47
_extend_blocks ,
46
48
_safe_reshape ,
47
49
get_block_type ,
Original file line number Diff line number Diff line change @@ -32,12 +32,6 @@ def df():
32
32
return pd .DataFrame (block_manager )
33
33
34
34
35
- def test_concat_dataframe (df ):
36
- # GH17728
37
- res = pd .concat ([df , df ])
38
- assert isinstance (res ._mgr .blocks [1 ], CustomBlock )
39
-
40
-
41
35
def test_concat_axis1 (df ):
42
36
# GH17954
43
37
df2 = pd .DataFrame ({"c" : [0.1 , 0.2 , 0.3 ]})
You can’t perform that action at this time.
0 commit comments