Skip to content

Pass through all connection options to gpudb/dbapi/core/connection.py KineticaConnection #16

@2dgrant

Description

@2dgrant

Apologies for not making a formal pull request - I had trouble getting PRs working.

Here are the changes proposed for gpudb/dbapi/core/connection.py KineticaConnection class constructor:

  1. Modify comment on connection_options arg to align with actual behaviour change:

         connection_options (Optional[dict], optional): Defaults to None. Allows all standard GPUdb.Options keys.
    
  2. Change handling of connection options in gpudb/dbapi/core/connection.py KineticaConnection. Necessary because otherwise KineticaConnection only makes use of bypass_ssl_cert_check, logging_level, and http_headers keys. It has been ignoring, for example, disable_auto_discovery, which must be True otherwise the connection call hangs (in my context at least):

     if connection_options:
         for key, value in connection_options.items():
             is_valid_options_key = hasattr(options, key)
             if is_valid_options_key:  ## check here rather than trying to catch gpudb.gpudb.GPUdbException - that check currently happens later
                 if key == 'http_headers':
                     for header_key, header_value in connection_options["http_headers"].items():
                         options.add_http_header(header_key, header_value)
                 else:
                     setattr(options, key, value)
                     if key == 'timeout':
                         logger.warning(f"The timeout setting supplied ({value} ms) does nothing unless in an async context")
             else:
                 raise ValueError(f"Unable to add '{key}' to options - not a standard key")
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions