Static Validation Configuration
The StaticValidationConfig
class controls how Pipelex handles validation errors during static analysis.
Configuration Options
class StaticValidationReaction(StrEnum):
RAISE = "raise" # Raise an exception
LOG = "log" # Log the error but continue
IGNORE = "ignore" # Silently ignore the error
class StaticValidationConfig(ConfigModel):
default_reaction: StaticValidationReaction
reactions: Dict[StaticValidationErrorType, StaticValidationReaction]
Fields
default_reaction
: Default reaction for validation errors not specifically configuredreactions
: Dictionary mapping specific error types to their reactions
Error Types and Reactions
Each validation error type can be configured to have one of three reactions:
RAISE
: Stops execution and raises an exceptionLOG
: Logs the error but allows execution to continueIGNORE
: Silently ignores the error
Example Configuration
[pipelex.static_validation_config]
default_reaction = "raise"
[pipelex.static_validation_config.reactions]
missing_input_variable = "log"
extraneous_input_variable = "log"
inadequate_input_concept = "log"
Validation Process
- When a validation error is detected, the system looks up the error type in the
reactions
dictionary - If the error type is found, the corresponding reaction is used
- If the error type is not found, the
default_reaction
is used - The reaction determines how the error is handled
Best Practices
- Use
RAISE
for critical errors that should never be ignored - Use
LOG
for warnings that should be addressed but aren't critical - Use
IGNORE
sparingly and only for known, harmless cases - Configure specific reactions for known error types
- Use a reasonable
default_reaction
for unexpected error types