pydata/pandas — pull request #7737 by jwass (2014-07-12 16:53:33+00:00)
Title: ENH: Use left._constructor on pd.merge

Use the _constructor property when creating the merge result to
preserve the output type.

If a [GeoPandas](http://github.com/geopandas/geopandas) `GeoDataFrame` is merged with a `DataFrame`, the result is hard-coded to always be `DataFrame` [GeoPandas Issue #118](https://github.com/geopandas/geopandas/issues/118). We'd like it to return `GeoDataFrame` in these cases

```
>>> import geopandas as gpd
>>> import pandas as pd

>>> gdf = gpd.GeoDataFrame(...)
>>> df = pd.DataFrame(...)

>>> merged = pd.merge(gdf, df, on='column')
>>> type(merged)
GeoDataFrame
```

This PR uses `left._constructor` to generate the result type for merge operations.