Jump to content

Archiving Datalab Created Conditions


Go to solution Solved by Chiragasourabh .,

Recommended Posts

I have used DataLab to create and push Conditions in a Workbook based on signal properties. I am not pushing this in as a formula, but rather using Start and End times calculated in DataLab.

In developing my code, I've ended up with multiple Conditions with the same name. I can ultimately find the correct one which I pushed in, but would like to "Delete" or "Archive" those incorrect Conditions.

I have been able to achieve this with Signals by setting the Archived parameter to True. I would like to do the equivalent for my conditions. My attempt, which does not seem to be working, is as follows:

condition_df = spy.search('worksheet_url')
condition_df.set_index('Name', inplace=True, drop=False)
condition_df['Maximum Duration'] = '1mo'
condition_df['Archived'] = True

spy.push(metadata=condition_df,
         replace={'Start': start_time, 'End':  end_time},
         workbook=workbook_id)

This deletes all capsules in my date range, but if I search for my conditions in the Data tab, the attempt to archive these conditions does not seem to have worked.

Link to comment
Share on other sites

  • Seeq Team

You can try archiving the conditions using API. The code below should archive the conditions in your worksheet. 

from seeq import sdk
import pandas as pd

# Setting up the SDK end point
items_api = sdk.ItemsApi(spy.client)

worksheet_url = 'worksheet_url'

condition_df = spy.search(worksheet_url)

for id in condition_df['ID']:
    items_api.archive_item(id=id)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...