astropy/astropy — pull request #1598 by taldcroft (2013-10-18 01:41:55+00:00)
Title: Metadata merging of equal values can result in incorrect output

While trying to revive the astroquery example in #1264 I ran into an issue with the new metadata merging #1343. If a column attribute (say `format`) was equal for both left and right then `merge_attr` was not set. In the particular case which showed the issue there were two tables with the same `format`, but the output of `vstack` had `format` set to the rightmost `description` because that was the last value of `merge_attr`.

Along the way I looked at `utils.metadata.merge` and it seems like the logic there should be made to match the logic for column attributes. In particular the `if .. ; if .. ; if ..` structure was replaced by `if .. elif .. elif .. else`. I *think* this makes sense but @astrofrog should confirm.