Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on July 19, 2022 5:28PM
Likes: 0
Replies: 3
The link https://doc.dataiku.com/dss/latest/python-api/outside-usage.html suggests that we can use
dataiku.clear_remote_dss() to clear remote configuration.
However, I see the following error. What is the correct approach here?
The use case I am working on is creating a dataset with the list of users on a different DSS instance for user management purposes. The python recipe is running into issues:
import dataiku
# Authenticate with other node
dataiku.set_remote_dss("OTHER_NODE", "KEY")
client = dataiku.api_client()
# Get list of users on the other node
users = client.list_users()
users = [(user["displayName"], user["login"], user["email"], user["enabled"]) for user in users]
users_df = pd.DataFrame(users, columns=["Display Name", "username", "email", "is_active"])
# Write list of users on other node in a dataset on current node
dataiku.clear_remote_dss()
users_dataset = dataiku.Dataset("users")
users_dataset.write_with_schema(users_df)
set_remote_dss
just in order to do a dataiku.api_client()
. You should rather instantiate a client for your remote DSS this way:import dataikuimport dataikuapihost = "OTHER_NODE"apiKey = "KEY"client = dataikuapi.DSSClient(host, apiKey)# And then the code does not need to change at all:# Get list of users on the other nodeusers = client.list_users()users = [(user["displayName"], user["login"], user["email"], user["enabled"]) for user in users]users_df = pd.DataFrame(users, columns=["Display Name", "username", "email", "is_active"])# Write list of users on other node in a dataset on current nodeusers_dataset = dataiku.Dataset("users")users_dataset.write_with_schema(users_df)
Try this: dataiku.clear_remote_dss_config()
This function is renamed in v11 as "dataiku.clear_remote_dss", since you're using v10 the above statement should work.
Thank you, I can confirm this works!