dstandish commented on code in PR #32099:
URL: https://github.com/apache/airflow/pull/32099#discussion_r1242541637


##########
airflow/models/baseoperator.py:
##########
@@ -1001,6 +1001,17 @@ def __enter__(self):
     def __exit__(self, exc_type, exc_val, exc_tb):
         SetupTeardownContext.set_work_task_roots_and_leaves()
 
+    @staticmethod
+    def add_task_to_context(task):

Review Comment:
   nice.  now here's a thought.... I think SetupTeardownContext should be 
private class, not part of the user API.  Or at least we should severely 
constrain which parts of it are public.
   So it occurs to me we should either (1) add a new class that is very 
lightweight and basically only has method `add_task` and return that instead of 
SetupTeardownContext.... OR... (2) we can maybe rename  SetupTeardownContext to 
AbstractSetupTeardownContext and make it `:meta private:` and then subclass 
`SetupTeardownContext` is public and only adds method `add_task` -- so all the 
methods would be "there" but they would be undocumented and therefore reserved 
for us -- there's an analogy with abstractoperator / baseoperator here. 



-- 
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]

Reply via email to