Enhance string interpolation to support hyphens in variable names and… (#2834)
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled

* Enhance string interpolation to support hyphens in variable names and add corresponding test cases. Update existing tests for consistency and formatting.

* Refactor tests in task_test.py by removing unused Task instances to streamline test cases for the interpolate_only method and related functions.
This commit is contained in:
Lorenze Jay
2025-05-14 16:06:07 -07:00
committed by GitHub
parent 30ef8ed70b
commit b4dfb19a3a
3 changed files with 157 additions and 72 deletions

View File

@@ -59,7 +59,7 @@ def interpolate_only(
# The regex pattern to find valid variable placeholders
# Matches {variable_name} where variable_name starts with a letter/underscore
# and contains only letters, numbers, and underscores
pattern = r"\{([A-Za-z_][A-Za-z0-9_]*)\}"
pattern = r"\{([A-Za-z_][A-Za-z0-9_\-]*)\}"
# Find all matching variables in the input string
variables = re.findall(pattern, input_string)