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

Remove unneeded try/except in Registry sqlite code

    XMLWordPrintable

    Details

    • Story Points:
      0.1
    • Sprint:
      DB_S22_12
    • Team:
      Data Access and Database
    • Urgent?:
      No

      Description

      Browsing through the code I noticed a piece of code that does not make much sense: https://github.com/lsst/daf_butler/blob/main/python/lsst/daf/butler/registry/databases/sqlite.py#L264-L269

              try:
                  return engine
              except sqlalchemy.exc.OperationalError as err:
                  raise RuntimeError(
                      f"Error creating connection with uri='{uri}', filename='{filename}', target={target}."
                  ) from err
      

      The try block is not going to throw ever, so the whole try/except is not needed. This came from my own changes in DM-26302.

        Attachments

          Issue Links

            Activity

            Hide
            salnikov Andy Salnikov added a comment -

            Tim Jenness, thanks for review! Jenkins is happy, merged.

            Show
            salnikov Andy Salnikov added a comment - Tim Jenness , thanks for review! Jenkins is happy, merged.

              People

              Assignee:
              salnikov Andy Salnikov
              Reporter:
              salnikov Andy Salnikov
              Watchers:
              Andy Salnikov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.