Fix Jinja2 template errors from invalid parameter/block names with special characters (SKY-7356) (#4644)

This commit is contained in:
Celal Zamanoglu
2026-02-06 00:58:36 +03:00
committed by GitHub
parent c35a744e27
commit 7bf1c721e4
8 changed files with 514 additions and 40 deletions

View File

@@ -166,7 +166,10 @@ class InvalidWaitBlockTime(SkyvernException):
class FailedToFormatJinjaStyleParameter(SkyvernException):
def __init__(self, template: str, msg: str) -> None:
super().__init__(
f"Failed to format Jinja style parameter {template}. Please make sure the variable reference is correct. reason: {msg}"
f"Failed to format Jinja style parameter '{template}'. "
f"Reason: {msg}. "
"If your block labels or parameter keys contain characters like '/', '-', or '.', "
"please rename them to use only letters, numbers, and underscores (e.g., 'State_Province' instead of 'State/Province')."
)
@@ -175,7 +178,9 @@ class MissingJinjaVariables(SkyvernException):
self.variables = variables
super().__init__(
f"There are missing variables for '{template}'. Please make sure the variables are supplied. Missing variables: {variables}"
f"Missing variables for '{template}'. Missing: {variables}. "
"If your block labels or parameter keys contain characters like '/', '-', or '.', "
"please rename them to use only letters, numbers, and underscores (e.g., 'State_Province' instead of 'State/Province')."
)