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

Fix broken postgres test due to attribute manager

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: daf_butler
    • Labels:
      None
    • Story Points:
      1
    • Sprint:
      DB_F20_06
    • Team:
      Data Access and Database
    • Urgent?:
      No

      Description

      My DM-25354 merge have broken unit test for Postgres (and I think for Oracle too):

              # cannot store empty key or value
              with self.assertRaises(Exception):
      >           attributes.set("", "value")
      E           AssertionError: Exception not raised
      

      The issue is with the handling handling of the empty strings, our sqlite backend adds constraint to the schema which disables empty strings, that was done to work around Oracle issue that treats empty strings as NULLS. as a result the code now raises integrity exception when saving empty string to database in sqlite case but there is no similar check for oracle/sqlite so that works OK.

      Simplest fix for my case would be either to suppress this check in the test completely or to add a new check in attribute manager that raises exception independently of a backend.

        Attachments

          Issue Links

            Activity

            Hide
            salnikov Andy Salnikov added a comment -

            Tim Jenness, as you have approved it already before I even asked for a review, I'm assigning it to you. Jenkins is still building but I do not expect problems there.

            Show
            salnikov Andy Salnikov added a comment - Tim Jenness , as you have approved it already before I even asked for a review, I'm assigning it to you. Jenkins is still building but I do not expect problems there.
            Hide
            salnikov Andy Salnikov added a comment -

            PR is here: https://github.com/lsst/daf_butler/pull/314 in case anyone else wants to check.

            Show
            salnikov Andy Salnikov added a comment - PR is here: https://github.com/lsst/daf_butler/pull/314 in case anyone else wants to check.
            Hide
            tjenness Tim Jenness added a comment -

            Looks fine

            Show
            tjenness Tim Jenness added a comment - Looks fine

              People

              Assignee:
              salnikov Andy Salnikov
              Reporter:
              salnikov Andy Salnikov
              Reviewers:
              Tim Jenness
              Watchers:
              Andy Salnikov, Jim Bosch, Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.