Created
May 31, 2021 07:44
-
-
Save sroecker/e94c881b594313ef2deb902f5f71a883 to your computer and use it in GitHub Desktop.
DataRobot Python API Upload Dataset from Catalog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upload_dataset_from_catalog(self, dataset): | |
import json | |
import time | |
client = dr.Client() | |
res = client.post(client.endpoint + "/projects/{}/predictionDatasets/datasetUploads/".format(self.id), json={"datasetId": dataset.id}) | |
dataset_id = json.loads(res.text)['datasetId'] | |
while dataset_id not in [ds.id for ds in self.get_datasets()]: | |
time.sleep(1) | |
return dataset_id | |
dr.Project.upload_dataset_from_catalog = upload_dataset_from_catalog |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment