ProtoLife / daptics-api

API documentation and clients for the daptics.ai design of experiments engine
https://daptics.ai
GNU General Public License v3.0
1 stars 1 forks source link

KeyError: 'verify_ssl_certificates' #50

Closed nhpackard closed 3 months ago

nhpackard commented 3 months ago

for all following branches of daptics-api,

get error on daptics.connect():

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Input In [5], in <cell line: 5>()
      1 daptics.options = auto_options
      3 # The 'connect' method will connect to the API server and obtain the
      4 # GraphQL schema.
----> 5 daptics.connect()

File [~/Projects/drug-library/Nuvisan/daptics-api/python_client/daptics_client/daptics_client.py:1087](http://localhost:9888/lab/workspaces/auto-Y/tree/Nuvisan/daptics-api/python_client/Nuvisan/daptics-api/python_client/daptics_client/daptics_client.py#line=1086), in DapticsClient.connect(self)
   1080     self.api_url = '{0}[/api](http://localhost:9888/api)'.format(self.host)
   1081     self.websocket_url = '{0}[/socket/websocket](http://localhost:9888/socket/websocket)'.format(ws_host)
   1083     http = gql.transport.requests.RequestsHTTPTransport(
   1084         self.api_url,
   1085         auth=self.auth,
   1086         use_json=True,
-> 1087         verify=self.options['verify_ssl_certificates'])
   1088     self.gql = gql.Client(
   1089         transport=http, fetch_schema_from_transport=True)
   1091 compat = self.check_api_compatibility()

KeyError: 'verify_ssl_certificates'
pzingg commented 3 months ago

I am using the main branch, commit d96efc6, after you merged #49, and am not getting the error. Instead I have the 0.16.0 compatibility error. If I change this on line 487 of daptics_client.py:

        self.client_version = '0.16.0'

I can log in successfully to https://api.daptics.ai

pzingg commented 3 months ago

Which script or notebook are you using? I was using test_login.py. Perhaps your script is clobbering the options array just before calling connect. I will look at the scripts and notebooks in the main branch to make sure they have the verfiy_ssl_certificates in them.

pzingg commented 3 months ago

Aha. 06_AutomationWorkflow.ipynb, Test.ipynb, and TestAuto.ipynb do clobber the options array. I will have to change the python code for them. We either need to use dict.update or add a method to DapticsClient: set_options(opts)