Skip to content

[Task]: Refactor duplicated template context construction into a private helper #244

Description

@sepandhaghighi

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions