Describe the feature you want to add
The logic for building the final rendering context is duplicated in multiple methods, such as render() and get_missing_variables(). This duplication makes the code harder to maintain and increases the risk of inconsistent behavior if the context-building logic changes.
Describe your proposed solution
Introduce a private helper method, _build_context(context: Optional[Dict[str, Any]]) -> Dict[str, Any], that merges custom_map and the provided context. Update render() and get_missing_variables() to use this helper instead of duplicating the same logic. This improves maintainability without changing the public API or behavior.
Describe alternatives you've considered, if relevant
No response
Additional context
No response
Describe the feature you want to add
The logic for building the final rendering context is duplicated in multiple methods, such as
render()andget_missing_variables(). This duplication makes the code harder to maintain and increases the risk of inconsistent behavior if the context-building logic changes.Describe your proposed solution
Introduce a private helper method,
_build_context(context: Optional[Dict[str, Any]]) -> Dict[str, Any], that mergescustom_mapand the providedcontext. Updaterender()andget_missing_variables()to use this helper instead of duplicating the same logic. This improves maintainability without changing the public API or behavior.Describe alternatives you've considered, if relevant
No response
Additional context
No response