Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hi All,
is it possible to reload a s3 dataset schema programmatically through the usage of the dataikuapi package? Thanks in advance!
Regards,
Filippo
Hello @fmonari,
Thank you so much for posting the question on Community.
Yes, you can reload a dataset's schema via Dataiku Python API as follows:
import dataiku
client = dataiku.api_client()
project = client.get_default_project()
dataset = project.get_dataset('your_dataset_name')
# `autodetect_settings` will however only detect if the schema is empty, so let's clear it.
settings = dataset.get_settings()
del settings.schema_columns[:]
settings.save()
# Redetect and save the suggestion.
settings = dataset.autodetect_settings()
settings.save()
Please see this DSS document https://doc.dataiku.com/dss/8.0/python-api/datasets-other.html#sql-dataset-modifying-settings for the details.
I hope this would help.
Sincerely,
Keiji, Dataiku Technical Support
Thanks KeijiY I will try it out!