Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-681

Make OptionBlock arguments discoverable

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 3.0.0-beta.1
    • 3.0.0-rc
    • None
    • None
    • 1
    • SDK5: Docs, Pathfind Antorized

    Description

      One of the reasons to have an option block is simplified reuse of options. Thus, I should be able to create an object that has all of the options and is reused.

      When testing with Python, I didn't get IDE auto completion and despite the seemingly flexible constructor, I could not do things like this:

      uoptions = UpsertOptions(expiration=Seconds(10))
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          Ellis.Breen Ellis Breen added a comment - - edited

          Have commented more on this topic on the other issue. Not sure of the answer yet.

          Ellis.Breen Ellis Breen added a comment - - edited Have commented more on this topic on the other issue. Not sure of the answer yet.
          david.kelly David Kelly added a comment -

          I like the stuff you've found in the comments in PYCBC-695. I'm thinking if the changes we make are not api breaking changes, this could be postponed a bit. But - it is really really nice to have in there. I guess IDK how much effort this will be, as well...

          david.kelly David Kelly added a comment - I like the stuff you've found in the comments in PYCBC-695 . I'm thinking if the changes we make are not api breaking changes, this could be postponed a bit. But - it is really really nice to have in there. I guess IDK how much effort this will be, as well...

          I'd really like to see this for beta.3. I think this goes to that ease-of-UX point raised earlier.

          What I see in the screenshots seems to work. I'm not sure if it'd have the type though from what I see? Point is that somehow, whether through code completion or some kind of discoverability in documentation, we need to make it easy to apply options, get squiggly lines in editors when they don't match up, etc.

          What do you think the level of effort is Ellis Breen?

          ingenthr Matt Ingenthron added a comment - I'd really like to see this for beta.3. I think this goes to that ease-of-UX point raised earlier. What I see in the screenshots seems to work. I'm not sure if it'd have the type though from what I see? Point is that somehow, whether through code completion or some kind of discoverability in documentation, we need to make it easy to apply options, get squiggly lines in editors when they don't match up, etc. What do you think the level of effort is Ellis Breen ?
          Ellis.Breen Ellis Breen added a comment -

          Well, it shouldn't be much work to port the existing OptionBlock hierarchy to being based on TypedDict. If we abandon the builder-style approach then all mutually exclusive options need to be encapsulated in one named parameter, but the only place I've seen mutually exclusive options so far is for old/new style durability. Perhaps there are some other examples I haven't thought of, though.

          To copy all kwargs to their associated OptionBlock would take a couple of days at least I think. It isn't complicated, as far as I can see, just a large surface area. I'll try to assess better tomorrow, but I can't think of any major caveats as is.

          Ellis.Breen Ellis Breen added a comment - Well, it shouldn't be much work to port the existing OptionBlock hierarchy to being based on TypedDict. If we abandon the builder-style approach then all mutually exclusive options need to be encapsulated in one named parameter, but the only place I've seen mutually exclusive options so far is for old/new style durability. Perhaps there are some other examples I haven't thought of, though. To copy all kwargs to their associated OptionBlock would take a couple of days at least I think. It isn't complicated, as far as I can see, just a large surface area. I'll try to assess better tomorrow, but I can't think of any major caveats as is.
          david.kelly David Kelly added a comment -

          Working through cluster interface today. Some options were missing (empty OptionBlocks), so working through those right now. Checking with PyCharm to be sure they are discoverable, so far so good.

          david.kelly David Kelly added a comment - Working through cluster interface today. Some options were missing (empty OptionBlocks), so working through those right now. Checking with PyCharm to be sure they are discoverable, so far so good.

          People

            david.kelly David Kelly
            ingenthr Matt Ingenthron
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty