Skip to content

Commit

Permalink
merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-gbloom committed Aug 26, 2024
1 parent 1417c44 commit 632400f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/snowflake/cli/api/entities/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,12 @@ def render_script_templates(
) -> List[str]:
"""
Input:
- project_root: path to project root
- render_from_str: function which renders a jinja template from a string and jinja context
- jinja_context: a dictionary with the jinja context
- scripts: list of script paths relative to the project root
Returns:
- List of rendered scripts content.
- List of rendered scripts content
Size of the return list is the same as the size of the input scripts list.
"""
scripts_contents = []
Expand All @@ -308,13 +309,13 @@ def render_script_templates(
result = render_from_str(template_content, jinja_context)
scripts_contents.append(result)

except jinja2.TemplateNotFound as e:
raise MissingScriptError(e.name) from e

except FileNotFoundError as e:
raise MissingScriptError(relpath) from e

except jinja2.TemplateSyntaxError as e:
raise InvalidScriptError(relpath, e, e.lineno) from e

except jinja2.UndefinedError as e:
raise InvalidScriptError(relpath, e, e.lineno) from e # type: ignore[attr-defined]
raise InvalidScriptError(relpath, e) from e

return scripts_contents

0 comments on commit 632400f

Please sign in to comment.