Superset Filters Caching Timeout

Context: A dashboard has been designed to display employee information in a company. To enable users to filter the displayed data based on departments, a filter option has been incorporated into the dashboard's filters section. This allows users to select specific departments and view the corresponding employee information.

Scenario:

In the given situation, a new department "Developer Relations" has been added to the company, and a new employee has joined this department.

Expectation :

The new employee information should be available in the report and the department filter on the dashboard is expected to display "Developer Relations" in the drop-down after reloading the dashboard.

Actual Results:

The newly added employee information is available. However, filter values are not being updated as expected, indicating a potential technical issue that requires further investigation to identify and resolve.

Root Cause Analysis (RCA) :

RCA reveals that the filter values are currently being stored in the cache. Consequently, when the dashboard is refreshed, the filter is retrieving data from the cache instead of the database, leading to outdated or incorrect information being displayed.

Solution: To address this issue, it is recommended to set the CACHE_TIMEOUT for the dataset of the Department filter. This will help ensure that the filter values are refreshed at a specified interval and retrieved from the database, providing users with up-to-date and accurate information.

Step 1:

Navigate to the "datasets" section and make modifications to the dataset for the department filter.

Step 2:

When you access the "Settings" option, you will notice that there is an absence of a value for "CACHE TIMEOUT".

Step 3:

Customize the timeout value according to your preferences. For instance, you can set it to 5 seconds and then save the changes.

Step 4 :

Proceed to your dashboard and refresh it.

Step 5: Verification

Upon refreshing, you will notice that "Developer Relations" has been added to the list of filters. That's pretty cool!

Step 6: Filter Testing

By choosing "Developer Relations" as the department and clicking on "APPLY FILTERS", you will be able to view only the employees belonging to that particular department.

Conclusion :

In conclusion, the technical issue that caused outdated and incorrect information to be displayed on the dashboard was successfully resolved by implementing a CACHE_TIMEOUT for the department filter dataset. This solution not only added the new department to the filter list but also ensured that all filter values were refreshed at a specified interval and retrieved from the database, providing users with up-to-date and accurate information. The successful resolution of this issue highlights the importance of conducting a thorough root cause analysis and implementing appropriate solutions to ensure the functionality and usability of any system or tool.

Github Repo :

https://github.com/raowaqasakram/superset-filter-caching-timeout

Happy Learning!