Can I update a dataset on DOMO without having to load the entire dataset?

OlaBola
OlaBola Member
edited October 2022 in APIs & Domo Developer

Right now I have a dataset in DOMO with a certain number of columns. If I append to that dataset using datasets.data_import with a dataframe that has an additional column the data upload is rejected. I want it to accept the import and add an additional column in the dataset in domo

Currently the way I do this is by catching an error when I import data and loading the dataset using domo.ds_get. I concat the domo dataset with the dataset I want to upload with the additional column using pd.concat([domo_dataframe, new_dataframe_with_extra_column]). Then I use domo.ds_update to upload the dataset which updates the schema.

Is there a way to do this where I don't have to load the domo dataset into memory? I want to just provide a dataframe to append to a domo dataset and if the schemas don't match then I want domo to add the additional columns on its end.


Thank you

Answers

  • Hi @OlaBola ,

    You can use https://api.domo.com/v1/datasets/{DATASET_ID} end point to get the schema of your existing Domo dataset.

    Once you get the schema, compare it with you new dataframe which you are trying to upload, if it does not match, execute the update statement which would reset / update the schema and load the data.

    This way, you do not need to store the domo dataset in-memory, and you can still do what is needed.


    Thanks

    Aditya Jain

    'Happy to Help'