How to close an API connection and start a new one?
Using the python API:
import dataikuapi
client = dataikuapi.DSSClient(https://"some_host"….)
…. process some things
client = dataikuapi.DSSClient(https://"some_other_host"….)
…. process some things
How can I close the connection so I can move on to another host? I was looking for client.close() or something similar. I tried just making a new client like above, but I got a screed of errors on the second client. I'm sure it's simple, but I can't find it in the documents. Thanks for any help. We're on DSS14.1.0 if that is relevant.
Operating system used: Windows 11
Best Answer
-
Lol. Well, actually I had an extraneous bit in the URL of the second host. Once I fixed that, I was able to make it work like the logic above without needing to close anything. It just works. :-)
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023, Circle Member Posts: 2,611 NeuronWe you are using the dataikuapi each DSSClient object is independent. So just make sure you using a different client object and you will be fine:
client = dataikuapi.DSSClient(https://"some_host"….) another_client = dataikuapi.DSSClient(https://"some_other_host"….)
With the internal dataiku package you need to use:
dataiku.clear_remote_dss()