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

Please rename DbStorage.next to something less confusing

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Invalid
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: daf_persistence
    • Labels:
      None
    • Team:
      Data Access and Database

      Description

      lsst.daf.persistence.DbStorage has a method named next that does not act like a python iterator. This makes the Python interface confusing. Please rename the method to something else (preferably both in C++ and Python).

      Thanks to Tim Jenness for discovering this.

        Attachments

          Issue Links

            Activity

            Hide
            tjenness Tim Jenness added a comment -

            Yes, DM-7226 has to be reverted because the C++ next method is not at all related to the Python2 next special method. It would be great if we removed the confusion completely by renaming the C++ method to nextRow or nextResult or something.

            Show
            tjenness Tim Jenness added a comment - Yes, DM-7226 has to be reverted because the C++ next method is not at all related to the Python2 next special method. It would be great if we removed the confusion completely by renaming the C++ method to nextRow or nextResult or something.
            Hide
            rowen Russell Owen added a comment - - edited

            I feel that any name like nextX implies that the method returns the next "x". Since this method simply advances a pointer without returning any information (other than a bool indicating that there is a next result), I hope you can figure out a name that makes this more obvious. I suggest gotoNextResult or even just gotoNext.

            Show
            rowen Russell Owen added a comment - - edited I feel that any name like nextX implies that the method returns the next "x". Since this method simply advances a pointer without returning any information (other than a bool indicating that there is a next result), I hope you can figure out a name that makes this more obvious. I suggest gotoNextResult or even just gotoNext .
            Hide
            ktl Kian-Tat Lim added a comment -

            We should be moving to deprecate DbStorage and replace it with SQLAlchemy (and/or Butler access to database datasets). But I'm not sure if right now is the time.

            Show
            ktl Kian-Tat Lim added a comment - We should be moving to deprecate DbStorage and replace it with SQLAlchemy (and/or Butler access to database datasets). But I'm not sure if right now is the time.
            Hide
            tjenness Tim Jenness added a comment -

            This code was removed in DM-13788.

            Show
            tjenness Tim Jenness added a comment - This code was removed in DM-13788 .

              People

              Assignee:
              npease Nate Pease [X] (Inactive)
              Reporter:
              rowen Russell Owen
              Watchers:
              Kian-Tat Lim, Nate Pease [X] (Inactive), Russell Owen, Steve Pietrowicz, Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.