Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-9503

afw catalog asAstropy fails due to multiple columns of same name

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None

      Description

      When using catalog.asAstropy(), we experience an error when converting certain tables:

      >>> catalog.asAstropy()
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "/slac/lsst/stack/DarwinX86/afw/12.1+1/python/lsst/afw/table/_syntax.py", line 272, in BaseCatalog_asAstropy
          return cls(columns, meta=meta, copy=False)
        File "/slac/lsst/stack/DarwinX86/miniconda2/3.19.0.lsst4/lib/python2.7/site-packages/astropy/table/table.py", line 360, in __init__
          init_func(data, names, dtype, n_cols, copy)
        File "/slac/lsst/stack/DarwinX86/miniconda2/3.19.0.lsst4/lib/python2.7/site-packages/astropy/table/table.py", line 624, in _init_from_list
          self._init_from_cols(cols)
        File "/slac/lsst/stack/DarwinX86/miniconda2/3.19.0.lsst4/lib/python2.7/site-packages/astropy/table/table.py", line 697, in _init_from_cols
          self._make_table_from_cols(self, newcols)
        File "/slac/lsst/stack/DarwinX86/miniconda2/3.19.0.lsst4/lib/python2.7/site-packages/astropy/table/table.py", line 729, in _make_table_from_cols
          raise ValueError('Duplicate column names')
      ValueError: Duplicate column names
      

        Attachments

          Activity

          Hide
          jbosch Jim Bosch added a comment -

          Looks great! Thanks for the fix, and sorry for the slow review for something so trivial.

          Show
          jbosch Jim Bosch added a comment - Looks great! Thanks for the fix, and sorry for the slow review for something so trivial.
          Hide
          swinbank John Swinbank added a comment -

          Hey Brian Van Klaveren — looks like this is still awaiting merging. Anything we need to do to unblock it?

          Show
          swinbank John Swinbank added a comment - Hey Brian Van Klaveren — looks like this is still awaiting merging. Anything we need to do to unblock it?
          Hide
          jbosch Jim Bosch added a comment -

          This fix seems to have made it to master somehow, despite the fact that the (conflicting, pre-pybind11) PR for this ticket hasn't been merged. Closing the ticket and the PR.

          Show
          jbosch Jim Bosch added a comment - This fix seems to have made it to master somehow, despite the fact that the (conflicting, pre-pybind11) PR for this ticket hasn't been merged. Closing the ticket and the PR.

            People

            • Assignee:
              bvan Brian Van Klaveren
              Reporter:
              bvan Brian Van Klaveren
              Reviewers:
              Jim Bosch
              Watchers:
              Brian Van Klaveren, Jim Bosch, John Swinbank
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel