Jump to content

Clearing an item's cache with Seeq Data Lab


Teddy

Recommended Posts

  • Administrators

Recently we have gotten several requests to clear an item's cache in Seeq with Seeq Data Lab (SDL).  

The following python script creates a function that will clear an items cache when an item's ID is given as an input. Note: this script assumes you are using SDL.

# imports
from seeq import sdk

# Setup Items API
items_api = sdk.ItemsApi(spy._login.client)

# Cache clearing function
def ItemCacheClearingTool(itemID):
    try:
        clearCache = items_api.clear_cache(id=itemID)
    except:
        print('Error clearing cache for item ' + itemID)

Screenshot of the Jupyter Notebook used to create the function:

Capture.PNG

 

This function can be used in for loops or applied to columns in a dataframe to clear multiple items' caches at a time.  

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...