APIs & Domo Developer

APIs & Domo Developer

PyDomo - DS_Update to Append Data?

Hello all,

I've written a script that ideally will create a datastream into Domo. At the moment though, I'm struggling to find a way to replace the update method of ds_update() from PyDomo. The default appears to be replacing the data, but I need to append the dataset.

Does anyone have any experience with this? Any help would be greatly appreciated? Thanks!

Tagged:

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In

Comments

  • pydomo/ds_update doesn't support append at this time. You could configure a recursive dataflow to append your data.

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • @andrew10196 I'm not 100% sure if this solves your problem but here is an example function that seems to work for me via domo.streams

    1. def append_domo_dataset(domo, stream_id, part, csv):
    2.  
    3.  
    4.     streams = domo.streams
    5.    
    6.     # update method needs to be either 'REPLACE' or 'APPEND'
    7.     execution = streams.create_execution(stream_id, update_method='APPEND')
    8.     execution_id = execution['id']
    9.     print('Created execution id number', execution_id, 'with update method', execution['updateMethod'])
    10.    
    11.     print('getting execution')
    12.     retrieved_execution = streams.get_execution(stream_id, execution_id)
    13.     print('Retrieved execution with id', retrieved_execution['id'])
    14.  
    15.  
    16.     execution = streams.upload_part(stream_id, execution_id, part, csv)
    17.     print('Uploaded part')
    18.  
    19.  
    20.     committed_execution = streams.commit_execution(stream_id, execution_id)
    21.     print('committed execution', committed_execution['id'])
    22.  
    23.  
    24.     return stream_id, execution['id'], retrieved_execution['id'], committed_execution['id']


  • Member
    edited September 2024

    I need to do the same, the problem with "streams" is the data fortma must be CVS format, I would like to send a dataframe.

    this method works but it can obly replace, dont allow the parrameter "update_method"

    domo.ds_update(dataset_id,dataframe)

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In