ephraimbuddy commented on PR #31616:
URL: https://github.com/apache/airflow/pull/31616#issuecomment-1569779712
> looks good to me. i am a little unsure about the name.
>
> maybe we could reuse the `teardown` function / decorator. so that you
could do
>
> ```
> with s1 >> teardown([t1, t2]):
> blah
> ```
>
> maybe if teardown receives a list, it just wraps with ContextWrapper -- so
we can keep the class named as is but it isn't the public or commonly used
interface?
In my opinion, `teardown` should not do much. It should specifically be for
converting tasks to teardown. Same with `setup`. I think that if we add this
behaviour, people might want to also see same for `setup`. The current
separation means that it can be used for setup tasks as well. e.g:
with t1 << context_wrapper([s1,s2]):
...
>
> other thing, there's not really a great way yet to use this context
manager and have multiple pairwise setups / teardowns
>
> e.g. the problem with this
>
> ```
> with s1 >> t1, s2 >> t2:
> work
> ```
>
> is that this defines s2 and s2 as "interior" to s1 / t1. i'm not sure if
there is a good solution for that.
>
> maybe for that we revert to something more traditional like
>
> ```
> with setup_teardown(s1 >> t1, s2 >> t2, ...):
> work
> ```
>
> and then these can be interpreted as not nested. that actually seems
somewhat promising.
>
I like the idea of `setup_teardown`
> also we still need to try and figure out some way to ban nonsensical /
ambiguous cases like
>
> ```
> with a >> b >> c:
> ...
> ```
I will work on this
--
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]