uranusjr commented on code in PR #74586:
URL: https://github.com/apache/airflow/pull/74586#discussion_r4249052732
##########
task-sdk/src/airflow/sdk/importers/yaml_importer/models.py:
##########
@@ -132,11 +146,39 @@ class XComRef(_MarkerRef):
class TemplateRef(_MarkerRef):
- """A Jinja template."""
+ """
+ A Jinja template, rendered server-side.
+
+ ``source`` is a Jinja string, or a :class:`FileRef` to load a template
file.
+ """
_marker_keys = TEMPLATE_KEYS
- source: str = Field(serialization_alias="$t",
validation_alias=AliasChoices(*TEMPLATE_KEYS))
+ source: str | FileRef = Field(serialization_alias="$t",
validation_alias=AliasChoices(*TEMPLATE_KEYS))
+
+
+class FileRef(_MarkerRef):
Review Comment:
Check added. Same rule as Python, no traversal.
##########
task-sdk/src/airflow/sdk/importers/yaml_importer/models.py:
##########
@@ -132,11 +146,39 @@ class XComRef(_MarkerRef):
class TemplateRef(_MarkerRef):
- """A Jinja template."""
+ """
+ A Jinja template, rendered server-side.
+
+ ``source`` is a Jinja string, or a :class:`FileRef` to load a template
file.
+ """
_marker_keys = TEMPLATE_KEYS
- source: str = Field(serialization_alias="$t",
validation_alias=AliasChoices(*TEMPLATE_KEYS))
+ source: str | FileRef = Field(serialization_alias="$t",
validation_alias=AliasChoices(*TEMPLATE_KEYS))
+
+
+class FileRef(_MarkerRef):
Review Comment:
Check added. Same rule as Python, no traversal past parent.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]