dstandish commented on code in PR #27723:
URL: https://github.com/apache/airflow/pull/27723#discussion_r1024781200
##########
airflow/models/expandinput.py:
##########
@@ -57,9 +57,9 @@ class MappedArgument(ResolveMixin):
_key: str
def get_task_map_length(self, run_id: str, *, session: Session) -> int |
None:
- # TODO (AIP-42): Implement run-time task map length inspection.
- # This simply marks the value as un-expandable at parse-time.
- return None
+ # TODO (AIP-42): Implement run-time task map length inspection. This is
+ # needed when we implement task mapping inside a mapped task group.
+ raise NotImplementedError()
Review Comment:
```suggestion
# TODO (AIP-42): Implement run-time task map length inspection. This
is
# needed when we implement task mapping inside a mapped task group.
raise NotImplementedError()
```
is the todo still needed? or perhaps does the TODO need qualifying re where
we actually do need to implement?
##########
airflow/models/abstractoperator.py:
##########
@@ -284,13 +282,22 @@ def iter_mapped_dependants(self) ->
Iterator[MappedOperator]:
)
def iter_mapped_task_groups(self) -> Iterator[MappedTaskGroup]:
- """Return mapped task groups this task belongs to."""
+ """Return mapped task groups this task belongs to.
+
+ Groups are returned from the closest to the outmost.
+
+ :meta private:
+ """
parent = self.task_group
while parent is not None:
if isinstance(parent, MappedTaskGroup):
yield parent
parent = parent.task_group
+ def get_closest_mapped_task_group(self) -> MappedTaskGroup | None:
Review Comment:
what does closest mean?
##########
airflow/models/abstractoperator.py:
##########
@@ -284,13 +282,22 @@ def iter_mapped_dependants(self) ->
Iterator[MappedOperator]:
)
def iter_mapped_task_groups(self) -> Iterator[MappedTaskGroup]:
- """Return mapped task groups this task belongs to."""
+ """Return mapped task groups this task belongs to.
+
+ Groups are returned from the closest to the outmost.
+
+ :meta private:
+ """
parent = self.task_group
while parent is not None:
if isinstance(parent, MappedTaskGroup):
yield parent
parent = parent.task_group
+ def get_closest_mapped_task_group(self) -> MappedTaskGroup | None:
Review Comment:
does it just mean child? because if we're talking about nested task groups,
closest could mean parent or child i suppose...
--
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]