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

Remove additional overloads for query and search

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 3.0.0-rc
    • None
    • None
    • None
    • 1

    Description

      If I'm getting something wrong that python needs I'm sorry. Looking at the Cluster API I can see that I think analytics has (properly?) only one overload:

       def analytics_query(self,  # type: Cluster
                              statement,  # type: str,
                              *options,  # type: AnalyticsOptions
                              **kwargs
                              ):
      

      query has also these two which I think are not necessary:

          @overload
          def query(self,
                    statement,
                    parameters=None,
                    timeout=None):
              pass
       
          @overload
          def query(self,
                    statement,  # type: str,
                    *options  # type: QueryOptions
                    ):
              # type: (...) -> IQueryResult
              pass
      

      same for search

          @overload
          def search_query(self,
                           index,  # type: str
                           query,  # type: Union[str, Query]
                           facets=None  # type: Mapping[str,Facet]
                           ):
              pass
       
          @overload
          def search_query(self,
                           index,  # type: str
                           query,  # type: Union[str, Query]
                           options,  # type: SearchOptions
                           ):
              pass
      

      For query i.e. two versions should be possible: query("statement") and query("statement", options)

      Note: I understand that there is still some discussion going on how how the overloading should be done (options vs. named params) but whatever the decision is going to be the APIs should be in sync.

      Attachments

        Activity

          People

            david.kelly David Kelly (Inactive)
            daschl Michael Nitschinger
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty