Description
Implement native parameter validation + typed instantiation in Kedro core, following the consolidated validation framework design. The core deliverable is that accessing context.params performs fail-fast validation and (when applicable) returns typed objects (e.g., Pydantic models / dataclasses) rather than raw dicts.
Context
The KEP proposes a validation framework integrated at the context level (KedroContext.params as the entry point), orchestrated by ParameterValidator, which:
- Merges config parameters with runtime params
- Discovers required types from pipeline node signatures via TypeExtractor + source filters
- Instantiates typed objects via ModelFactory
- Caches results for performance.
Possible Implementation
1. Context integration
- Implement
_get_validated_params() (or equivalent) and wire it to KedroContext.params as described in the KEP
- Add a cache keyed by environment + runtime params hash (or a safe equivalent) so repeated
context.params calls are cheap.
2. Type discovery
- Implement
TypeExtractor to walk the active pipeline(s) and inspect node function signatures + annotations.
- Use a
SourceFilter abstraction; in this ticket, focus on the ParameterFilter path (datasets can be added in future).
3. Model instantiation
- Implement ModelFactory to support:
- Pydantic models when installed (optional dependency).
- Python dataclasses.
- Fallback behavior: if no type requirement exists, return raw values untouched.
- Provide clear errors via custom exceptions (e.g., a specialized ValidationError that includes param path + expected type + source node info).
Draft implementation - https://github.com/kedro-org/kedro/tree/test/validate_no_hook/kedro/framework/validation
Possible Alternatives
NA
Description
Implement native parameter validation + typed instantiation in Kedro core, following the consolidated validation framework design. The core deliverable is that accessing context.params performs fail-fast validation and (when applicable) returns typed objects (e.g., Pydantic models / dataclasses) rather than raw dicts.
Context
The KEP proposes a validation framework integrated at the context level (
KedroContext.paramsas the entry point), orchestrated byParameterValidator, which:Possible Implementation
1. Context integration
_get_validated_params()(or equivalent) and wire it toKedroContext.paramsas described in the KEPcontext.paramscalls are cheap.2. Type discovery
TypeExtractorto walk the active pipeline(s) and inspect node function signatures + annotations.SourceFilterabstraction; in this ticket, focus on the ParameterFilter path (datasets can be added in future).3. Model instantiation
Draft implementation - https://github.com/kedro-org/kedro/tree/test/validate_no_hook/kedro/framework/validation
Possible Alternatives
NA