Ryan Patet Posted April 11 Share Posted April 11 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 More sharing options...
Seeq Team Kin How Posted April 12 Seeq Team Share Posted April 12 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 More sharing options...
Solution Chiragasourabh . Posted April 12 Solution Share Posted April 12 (edited) As a workaround, you can use the spy.push without replace parameter to archive the conditions. condition_df['Archived'] = True spy.push(metadata=condition_df,workbook=workbook_id) Edited April 12 by Chiragasourabh . Link to comment Share on other sites More sharing options...
Ryan Patet Posted April 12 Author Share Posted April 12 Thank you - I can confirm Chiragasourabh's solution removing the Replace statement from my push worked. I have not tried Kin How's solution, yet. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now