astropy/astropy — pull request #1343 by astrofrog (2013-09-20 21:50:21+00:00)
Title: Make meta-data merging emit warnings rather than raise exceptions by default

@taldcroft @hamogu - I would like to revisit the decision to make meta-data merging raise exceptions by default. I have been querying a table from Vizier using Astroquery and have a list of sub-tables from the overall master table, which I then want to join with ``vstack``. However, I then run into:

```
Traceback (most recent call last):
File "get_tables.py", line 34, in
tables_filt = t.vstack(tables_filt)
File "/Users/tom/Library/Python/2.7/lib/python/site-packages/astropy-0.3.dev5048-py2.7-macosx-10.8-x86_64.egg/astropy/table/operations.py", line 179, in vstack
_merge_col_meta(out, tables, col_name_map)
File "/Users/tom/Library/Python/2.7/lib/python/site-packages/astropy-0.3.dev5048-py2.7-macosx-10.8-x86_64.egg/astropy/table/operations.py", line 39, in _merge_col_meta
out_col.meta = metadata.merge(left_col.meta, right_col.meta)
File "/Users/tom/Library/Python/2.7/lib/python/site-packages/astropy-0.3.dev5048-py2.7-macosx-10.8-x86_64.egg/astropy/utils/metadata.py", line 77, in merge
.format(key, type(left[key]), type(right[key])))
astropy.utils.metadata.MergeConflictError: Cannot merge meta key u'ucd' types and
```

The conflicting meta-data is actually column meta-data so I had to do:

```
table.meta.clear()
for col in table.columns.values():
col.meta.clear()
```

which I think is far from obvious for newbies. Therefore I'd like to suggest that overwriting meta-data during a merge results in a warning by default, with the option to raise it as an exception.