def is_dtype_union_equal(source, target):
source = _get_dtype(source)<EOL>target = _get_dtype(target)<EOL>if is_categorical_dtype(source) and is_categorical_dtype(target):<EOL><INDENT>return source.ordered is target.ordered<EOL><DEDENT>return is_dtype_equal(source, target)<EOL>
Check whether two arrays have compatible dtypes to do a union.
numpy types are checked with ``is_dtype_equal``. Extension types are
checked separately.

Parameters
----------
source : The first dtype to compare
target : The second dtype to compare

Returns
----------
boolean
    Whether or not the two dtypes are equal.

>>> is_dtype_equal("int", int)
True

>>> is_dtype_equal(CategoricalDtype(['a', 'b'],
...                CategoricalDtype(['b', 'c']))
True

>>> is_dtype_equal(CategoricalDtype(['a', 'b'],
...                CategoricalDtype(['b', 'c'], ordered=True))
False