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

Unicode string not being interpreted correctly.

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: daf_base
    • Labels:
      None
    • Story Points:
      0.5
    • Team:
      Architecture

      Description

      The following (running on lsst-qserv-dax01)

      dataRoot="/datasets/gapon/data/DC_2013/calexps/"
      butlerPolicy="calexp"
      ids = id {'filter': u'g', 'field': 694, 'camcol': 4, 'run': 5646}
       
      def getImageByIds(self, ids):
          butler = lsst.daf.persistence.Butler(dataRoot)
          img = butler.get(butlerPolicy, dataId=ids)
          return img, butler
      

      Results in this error

        File "/lsst/stack/dax_imgserv/python/lsst/dax/imgserv/locateImage.py", line 286, in getImageByIds
          img = butler.get(self._butlerPolicy, dataId=ids)
        File "/lsst/stack/Linux64/daf_persistence/12.1/python/lsst/daf/persistence/butler.py", line 586, in get
          location = repoData.repo.map(datasetType, dataId)
        File "/lsst/stack/Linux64/daf_persistence/12.1/python/lsst/daf/persistence/repository.py", line 180, in map
          loc = self._mapper.map(*args, **kwargs)
        File "/lsst/stack/Linux64/daf_persistence/12.1/python/lsst/daf/persistence/mapper.py", line 173, in map
          return func(self.validate(dataId), write)
        File "/lsst/stack/Linux64/daf_butlerUtils/12.1+1/python/lsst/daf/butlerUtils/cameraMapper.py", line 294, in mapClosure
          return mapping.map(mapper, dataId, write)
        File "/lsst/stack/Linux64/daf_butlerUtils/12.1+1/python/lsst/daf/butlerUtils/mapping.py", line 142, in map
          return ButlerLocation(self.python, self.persistable, self.storage, path, additionalData, mapper)
        File "/lsst/stack/Linux64/daf_persistence/12.1/python/lsst/daf/persistence/butlerLocation.py", line 62, in __init__
          self.additionalData.set(k, v)
        File "/lsst/stack/Linux64/daf_base/12.1/python/lsst/daf/base/baseLib.py", line 4136, in _PS_setValue
          return _propertyContainerSet(self, name, value, _PS_typeMenu)
        File "/lsst/stack/Linux64/daf_base/12.1/python/lsst/daf/base/baseLib.py", line 4098, in _propertyContainerSet
          raise lsst.pex.exceptions.TypeError("Unknown value type for %s: %s" % (name, t))
      TypeError: Unknown value type for filter: <type 'unicode'>
      

        Attachments

          Issue Links

            Activity

            Hide
            tjenness Tim Jenness added a comment -

            This is because unicode is not in the type menu handled by PropertySet. It would work fine on python3. The quick fix is to just add an extra map of unicode to String to typeMenu.

            Show
            tjenness Tim Jenness added a comment - This is because unicode is not in the type menu handled by PropertySet. It would work fine on python3. The quick fix is to just add an extra map of unicode to String to typeMenu .
            Hide
            tjenness Tim Jenness added a comment -

            I think this fixes it. The modified tests fail without the associated patch and pass with it.

            Show
            tjenness Tim Jenness added a comment - I think this fixes it. The modified tests fail without the associated patch and pass with it.
            Hide
            Parejkoj John Parejko added a comment -

            Looks good. One comment about adding a comment.

            Show
            Parejkoj John Parejko added a comment - Looks good. One comment about adding a comment.
            Hide
            tjenness Tim Jenness added a comment -

            Merged.

            Show
            tjenness Tim Jenness added a comment - Merged.

              People

              Assignee:
              tjenness Tim Jenness
              Reporter:
              jgates John Gates
              Reviewers:
              John Gates
              Watchers:
              John Gates, John Parejko, Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.