Shlomit-B commented on code in PR #56066:
URL: https://github.com/apache/airflow/pull/56066#discussion_r2731110183


##########
task-sdk/src/airflow/sdk/definitions/dag.py:
##########
@@ -1576,3 +1582,79 @@ def factory(*args, **kwargs):
         return wrapper(dag_id_or_func)
 
     return wrapper
+
+
+@contextmanager
+def safe_dag():

Review Comment:
   > Agree with @ashb additional wrapper is no-go - it adds a lot of 
boilerplate code and readability suffers. What I would suggest you to do is to 
explore the capabilities that `attrs` custom init or pre_init does.
   > 
   >     * https://www.attrs.org/en/stable/init.html#pre-init
   > 
   >     * https://www.attrs.org/en/stable/init.html#custom-init
   > 
   > 
   > You could likely modify `DAG` to use custom init and wrap the 
`__attrs_init__` with `try/except` and handle constructor failures this way.
   
   Thanks! I'll check this out



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