amoghrajesh commented on code in PR #73607:
URL: https://github.com/apache/airflow/pull/73607#discussion_r4375681679
##########
dev/registry/extract_parameters.py:
##########
@@ -526,14 +526,17 @@ def _execute_chain_calls_resumable(cls: type, depth: int)
-> bool:
"""Return True if some class along `cls`'s resolved `execute()` chain
calls execute_resumable().
Same walk as `_delegates_execute_to`: a delegating override's own source
may not mention
- `execute_resumable` even though the class it hands off to does.
+ `execute_resumable` even though the class it hands off to does. Comments
are stripped
+ for the same reason they are in `_next_execute_hop`: a comment naming the
call is not
+ the call.
"""
owner = _find_owner_of_execute(cls.__mro__, 0)
remaining = depth
while owner is not None:
source = _get_method_source(owner, "execute")
if source is None:
return False
+ source = _strip_comment_lines(source)
if "execute_resumable" in source:
return True
Review Comment:
Yep, handled in 3b2c8902cac
##########
dev/registry/tests/test_extract_parameters.py:
##########
@@ -382,6 +382,17 @@ def execute(self, context):
assert is_durable_capable(CommentedNonDelegatingSubclass,
FakeResumableJobMixin) is False
+ def
test_comment_mentioning_execute_resumable_is_not_mistaken_for_a_call(self):
+ """The mixin walk strips comments the same way the delegation walk
does, or a
+ subclass that only names `execute_resumable` in a comment reports
capable."""
+
+ class CommentedNonResumableOperator(FullyImplementedResumableOperator):
+ def execute(self, context):
+ # this path deliberately skips execute_resumable(context)
+ return None
+
+ assert is_durable_capable(CommentedNonResumableOperator,
FakeResumableJobMixin) is False
Review Comment:
Yep, handled in 3b2c8902cac
##########
dev/registry/tests/test_extract_parameters.py:
##########
@@ -706,6 +781,12 @@ def defer(self, *args, **kwargs):
def test_comment_mentioning_defer_is_not_mistaken_for_deferral(self):
assert supports_deferrable(DeferralCommentOnlyOperator) is False
+ def
test_helper_is_resolved_against_the_class_under_test_not_the_hop_target(self):
+ assert supports_deferrable(SubclassOverridingHelperToDefer) is True
+
+ def test_helper_reached_again_with_more_depth_budget_is_rewalked(self):
+ assert supports_deferrable(SharedHelperReachedAtTwoBudgets) is True
Review Comment:
Yep, handled in 3b2c8902cac
--
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]