Yeoman generator that scaffolds Superset visualization plugins and packages with proper structure and boilerplate code
63
Build a utility that configures and manages multiple cache layers for a data visualization application.
Your utility should provide functionality to:
@generates
def configure_caches(config: dict) -> dict:
"""
Configure multiple cache instances based on provided configuration.
Args:
config: Dictionary with cache configurations. Each key is a cache name,
and each value is a dict with 'backend' and 'timeout' keys.
Example: {'metadata_cache': {'backend': 'redis', 'timeout': 3600}}
Returns:
Dictionary mapping cache names to configured cache instances
"""
pass
def generate_cache_key(base_key: str, user_id: int, security_filters: list) -> str:
"""
Generate a cache key that incorporates base key, user context, and security filters.
Args:
base_key: Base identifier for the cached resource
user_id: User identifier for per-user caching
security_filters: List of security filter strings to include in key
Returns:
A deterministic cache key string that uniquely identifies the cached item
"""
pass
def resolve_cache_timeout(custom: int = None, chart: int = None,
dataset: int = None, database: int = None,
default: int = 300) -> int:
"""
Resolve cache timeout using hierarchy: custom → chart → dataset → database → default.
Args:
custom: Custom timeout value (highest priority)
chart: Chart-level timeout
dataset: Dataset-level timeout
database: Database-level timeout
default: System default timeout (lowest priority)
Returns:
The resolved timeout value in seconds
"""
pass
def invalidate_cache_by_resource(cache_instance: dict, resource_uid: str) -> list:
"""
Invalidate all cache entries associated with a specific resource.
Args:
cache_instance: The cache instance dictionary (from configure_caches)
resource_uid: Unique identifier for the resource
Returns:
List of invalidated cache keys
"""
passProvides caching infrastructure and utilities for business intelligence applications.
Install with Tessl CLI
npx tessl i tessl/npm-superset-ui--generator-supersetdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10