# Buggy code
def get_reindexed_values(self, empty_dtype, upcasted_na):
    if upcasted_na is None:
        # No upcasting is necessary
        fill_value = self.block.fill_value
        values = self.block.get_values()
    else:
        fill_value = upcasted_na

        if self.is_na:
            if getattr(self.block, "is_object", False):
                # we want to avoid filling with np.nan if we are
                # using None; we already know that we are all
                # nulls
                values = self.block.values.ravel(order="K")
                if len(values) and values[0] is None:
                    fill_value = None

            if getattr(self.block, "is_datetimetz", False) or is_datetimetz(
                empty_dtype
            ):
                pass
            elif getattr(self.block, "is_categorical", False):
                pass
            elif getattr(self.block, "is_sparse", False):
                pass
            else:
                missing_arr = np.empty(self.shape, dtype=empty_dtype)
                missing_arr.fill(fill_value)
                return missing_arr

        if not self.indexers:
            if not self.block._can_consolidate:
                # preserve these for validation in _concat_compat
                return self.block.values

        if self.block.is_bool and not self.block.is_categorical:
            # External code requested filling/upcasting, bool values must
            # be upcasted to object to avoid being upcasted to numeric.
            values = self.block.astype(np.object_).values
        elif self.block.is_extension:
            values = self.block.values
        else:
            # No dtype upcasting is done here, it will be performed during
            # concatenation itself.
            values = self.block.get_values()

    if not self.indexers:
        # If there's no indexing to be done, we want to signal outside
        # code that this array must be copied explicitly.  This is done
        # by returning a view and checking `retval.base`.
        values = values.view()

    else:
        for ax, indexer in self.indexers.items():
            values = algos.take_nd(values, indexer, axis=ax, fill_value=fill_value)

    return values


# Traceback (AttributeError)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-42-457226d62f27> in <module>()
1 a = pd.DataFrame([[1, 2]], dtype='datetime64[ns, UTC]')
2 b = pd.DataFrame([[3]], dtype='datetime64[ns, UTC]')
----> 3 pd.concat([a, b])

~/.pyenv/versions/3.6.2/envs/general/lib/python3.6/site-packages/pandas/core/reshape/concat.py in concat(objs, axis, join, join_axes, ignore_index, keys, levels, names, verify_integrity, sort, copy)
224                        verify_integrity=verify_integrity,
225                        copy=copy, sort=sort)
--> 226     return op.get_result()
227
228

~/.pyenv/versions/3.6.2/envs/general/lib/python3.6/site-packages/pandas/core/reshape/concat.py in get_result(self)
421             new_data = concatenate_block_managers(
422                 mgrs_indexers, self.new_axes, concat_axis=self.axis,
--> 423                 copy=self.copy)
424             if not self.copy:
425                 new_data._consolidate_inplace()

~/.pyenv/versions/3.6.2/envs/general/lib/python3.6/site-packages/pandas/core/internals.py in concatenate_block_managers(mgrs_indexers, axes, concat_axis, copy)
5419         else:
5420             b = make_block(
-> 5421                 concatenate_join_units(join_units, concat_axis, copy=copy),
5422                 placement=placement)
5423         blocks.append(b)

~/.pyenv/versions/3.6.2/envs/general/lib/python3.6/site-packages/pandas/core/internals.py in concatenate_join_units(join_units, concat_axis, copy)
5563     to_concat = [ju.get_reindexed_values(empty_dtype=empty_dtype,
5564                                          upcasted_na=upcasted_na)
-> 5565                  for ju in join_units]
5566
5567     if len(to_concat) == 1:

~/.pyenv/versions/3.6.2/envs/general/lib/python3.6/site-packages/pandas/core/internals.py in <listcomp>(.0)
5563     to_concat = [ju.get_reindexed_values(empty_dtype=empty_dtype,
5564                                          upcasted_na=upcasted_na)
-> 5565                  for ju in join_units]
5566
5567     if len(to_concat) == 1:

~/.pyenv/versions/3.6.2/envs/general/lib/python3.6/site-packages/pandas/core/internals.py in get_reindexed_values(self, empty_dtype, upcasted_na)
5849
5850             if not self.indexers:
-> 5851                 if not self.block._can_consolidate:
5852                     # preserve these for validation in _concat_compat
5853                     return self.block.values

AttributeError: 'NoneType' object has no attribute '_can_consolidate'

# Fixed code
def get_reindexed_values(self, empty_dtype, upcasted_na):
    if upcasted_na is None:
        # No upcasting is necessary
        fill_value = self.block.fill_value
        values = self.block.get_values()
    else:
        fill_value = upcasted_na

        if self.is_na:
            if getattr(self.block, "is_object", False):
                # we want to avoid filling with np.nan if we are
                # using None; we already know that we are all
                # nulls
                values = self.block.values.ravel(order="K")
                if len(values) and values[0] is None:
                    fill_value = None

            if getattr(self.block, "is_datetimetz", False) or is_datetimetz(
                empty_dtype
            ):
                if self.block is None:
                    array = empty_dtype.construct_array_type()
                    missing_arr = array([fill_value], dtype=empty_dtype)
                    return missing_arr.repeat(self.shape[1])
                pass
            elif getattr(self.block, "is_categorical", False):
                pass
            elif getattr(self.block, "is_sparse", False):
                pass
            else:
                missing_arr = np.empty(self.shape, dtype=empty_dtype)
                missing_arr.fill(fill_value)
                return missing_arr

        if not self.indexers:
            if not self.block._can_consolidate:
                # preserve these for validation in _concat_compat
                return self.block.values

        if self.block.is_bool and not self.block.is_categorical:
            # External code requested filling/upcasting, bool values must
            # be upcasted to object to avoid being upcasted to numeric.
            values = self.block.astype(np.object_).values
        elif self.block.is_extension:
            values = self.block.values
        else:
            # No dtype upcasting is done here, it will be performed during
            # concatenation itself.
            values = self.block.get_values()

    if not self.indexers:
        # If there's no indexing to be done, we want to signal outside
        # code that this array must be copied explicitly.  This is done
        # by returning a view and checking `retval.base`.
        values = values.view()

    else:
        for ax, indexer in self.indexers.items():
            values = algos.take_nd(values, indexer, axis=ax, fill_value=fill_value)

    return values