tessl install tessl/pypi-kedro@1.1.0Kedro helps you build production-ready data and analytics pipelines
Agent Success
Agent success rate when using this tile
98%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.32x
Baseline
Agent success rate without this tile
74%
Build a configuration system that registers custom OmegaConf resolvers to dynamically compute values in YAML configuration files.
compute that evaluates mathematical expressions (e.g., "2+3" returns 5.0) is registered with OmegaConf @testenv_default that returns an environment variable value or a default (e.g., env_default("PATH", "/default") returns the PATH value or "/default") is registered with OmegaConf @test@generates
from typing import Any, Dict, Callable
from omegaconf import OmegaConf
def compute_resolver(expression: str) -> float:
"""
Resolver that evaluates a mathematical expression.
Args:
expression: A string containing a mathematical expression (e.g., "2+3", "10*5")
Returns:
The evaluated result as a float
"""
pass
def env_default_resolver(env_var: str, default: str) -> str:
"""
Resolver that gets an environment variable or returns a default value.
Args:
env_var: Name of the environment variable to look up
default: Default value to return if environment variable is not set
Returns:
The environment variable value if set, otherwise the default value
"""
pass
def register_custom_resolvers() -> None:
"""
Registers all custom OmegaConf resolvers.
This function should register the 'compute' and 'env_default' resolvers
with OmegaConf so they can be used in configuration files.
"""
pass
def load_config(config_path: str) -> Dict[str, Any]:
"""
Loads configuration from a YAML file with custom resolver support.
Args:
config_path: Path to the YAML configuration file
Returns:
Dictionary containing the loaded and resolved configuration
"""
passProvides advanced YAML configuration with variable interpolation support.
Provides configuration management framework with OmegaConf integration.