or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/kedro@1.1.x
tile.json

tessl/pypi-kedro

tessl install tessl/pypi-kedro@1.1.0

Kedro 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%

task.mdevals/scenario-10/

Custom Configuration Resolvers

Build a configuration system that registers custom OmegaConf resolvers to dynamically compute values in YAML configuration files.

Capabilities

Register custom resolvers

  • A resolver named compute that evaluates mathematical expressions (e.g., "2+3" returns 5.0) is registered with OmegaConf @test
  • A resolver named env_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

Load configuration with resolvers

  • A YAML configuration file using "${compute:10*2}" is loaded and the value resolves to 20.0 @test
  • A YAML configuration file using both "${compute:5+5}" and "${env_default:USER,guest}" resolves both values correctly @test

Implementation

@generates

API

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
    """
    pass

Dependencies { .dependencies }

OmegaConf { .dependency }

Provides advanced YAML configuration with variable interpolation support.

kedro { .dependency }

Provides configuration management framework with OmegaConf integration.