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

Butler Repository fails to import mapper module

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: butler
    • Labels:
      None

      Description

      when a mapper is specified to the butler as a dot-delimited string (i.e. the module is part of the mapper specification), the importer fails. For example if you use

      RepositoryArgs(mapper='lsst.daf.persistence.CameraMapper')}}
      You get the output
      {{Traceback (most recent call last):
        File "tests/testImportMapper.py", line 52, in test
          butler = dafPersist.Butler(outputs=repositoryArgs)
        File "/Users/n8pease/2/lsstsw/build/daf_persistence/python/lsst/daf/persistence/butler.py", line 285, in __init__
          self._addRepo(args, inout='out', defaultMapper=defaultMapper, butlerIOParents=butlerIOParents)
        File "/Users/n8pease/2/lsstsw/build/daf_persistence/python/lsst/daf/persistence/butler.py", line 382, in _addRepo
          repo = Repository(cfg)
        File "/Users/n8pease/2/lsstsw/build/daf_persistence/python/lsst/daf/persistence/repository.py", line 88, in __init__
          self._initMapper(repositoryCfg)
        File "/Users/n8pease/2/lsstsw/build/daf_persistence/python/lsst/daf/persistence/repository.py", line 108, in _initMapper
          module = __import__(module)
      ImportError: No module named CameraMapper
      

      The module that contains the CameraMapper (lsst.daf.persistence) should be imported, not the module+class name.

        Attachments

          Activity

          Hide
          npease Nate Pease added a comment -

          this got fixed during DM-7469

          Show
          npease Nate Pease added a comment - this got fixed during DM-7469

            People

            • Assignee:
              npease Nate Pease
              Reporter:
              npease Nate Pease
              Watchers:
              Nate Pease
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel