Open
Description
Code Sample, a copy-pastable example if possible
import pandas as pd
dd1=pd.DataFrame({"a":pd.Series(["x"], dtype="category")})
dd2=pd.DataFrame({"a":pd.Series(["x", "y"], dtype="category")})
dd3=dd1.merge(dd2)
dd3.dtypes # categorical turns into object type
Problem description
It would be nice if when merging on categorical columns, their categorical nature would remain by an automatic union_categoricals. Currently only categoricals with identical values remain categorical and merge on non-identical categoricals becomes object type.