You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/08/17 03:01:49 UTC

[GitHub] [airflow] josh-fell opened a new pull request, #25752: Add ``@task.short_circuit`` TaskFlow decorator

josh-fell opened a new pull request, #25752:
URL: https://github.com/apache/airflow/pull/25752

   To complete the "Python operator" set, this PR adds a TaskFlow decorator abstraction for the `ShortCircuitOperator`.
   
   TODO:
   - [ ] Add unit tests
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk commented on pull request #25752: Add ``@task.short_circuit`` TaskFlow decorator

Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #25752:
URL: https://github.com/apache/airflow/pull/25752#issuecomment-1222512339

   > > A documentation should be added somewhere (docstring? TaskFlow howto?) to describe what returning True and False means.
   > 
   > That's fair. I think updating the docs somewhere would be my preference. Maybe in the [Python Operator how-tos doc](https://airflow.apache.org/docs/apache-airflow/stable/howto/operator/python.html#howto-operator-shortcircuitoperator)?
   
   Sounds good.
   
   > Side note, maybe we should add a TaskFlow Decorators section to the [Python API Reference](https://airflow.apache.org/docs/apache-airflow/stable/python-api-ref.html) in a separate PR. WDYT?
   
   Agree. Also - since some of the decorators are coming from the providers, we should add a section in https://airflow.apache.org/docs/apache-airflow-providers/core-extensions/index.html (I can add it and also refactor this page a bit as it is a bit too long now and I think we should make it more compact).
   
   How about also reversing (in separate PR) the "priority" of "classic" vs. "taskflow" approach ? I think we are quickly approaching the point where  taskflow is generally recommended and "on-par" approach than Classic and we should promote it as "the" way of doing things while marking classic approach as somewhat (not entirely but somewhat) legacty.
   
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] uranusjr commented on a diff in pull request #25752: Add ``@task.short_circuit`` TaskFlow decorator

Posted by GitBox <gi...@apache.org>.
uranusjr commented on code in PR #25752:
URL: https://github.com/apache/airflow/pull/25752#discussion_r963972636


##########
docs/apache-airflow/howto/operator/python.rst:
##########
@@ -129,19 +129,18 @@ If you want the context related to datetime objects like ``data_interval_start``
 .. _howto/operator:ShortCircuitOperator:
 
 ShortCircuitOperator
-========================
+====================

Review Comment:
   Should we change this section title to `@task.short_circuit`?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] jedcunningham merged pull request #25752: Add ``@task.short_circuit`` TaskFlow decorator

Posted by GitBox <gi...@apache.org>.
jedcunningham merged PR #25752:
URL: https://github.com/apache/airflow/pull/25752


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] josh-fell commented on a diff in pull request #25752: Add ``@task.short_circuit`` TaskFlow decorator

Posted by GitBox <gi...@apache.org>.
josh-fell commented on code in PR #25752:
URL: https://github.com/apache/airflow/pull/25752#discussion_r963983734


##########
docs/apache-airflow/howto/operator/python.rst:
##########
@@ -129,19 +129,18 @@ If you want the context related to datetime objects like ``data_interval_start``
 .. _howto/operator:ShortCircuitOperator:
 
 ShortCircuitOperator
-========================
+====================

Review Comment:
   I do think this how-to doc should be refactored a little to really emphasize the decorator use or even specifically having a `howto/decorators/python` doc instead.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] josh-fell commented on pull request #25752: Add ``@task.short_circuit`` TaskFlow decorator

Posted by GitBox <gi...@apache.org>.
josh-fell commented on PR #25752:
URL: https://github.com/apache/airflow/pull/25752#issuecomment-1238345246

   Update the Python operator how-to doc with references to the new decorator.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] josh-fell commented on pull request #25752: Add ``@task.short_circuit`` TaskFlow decorator

Posted by GitBox <gi...@apache.org>.
josh-fell commented on PR #25752:
URL: https://github.com/apache/airflow/pull/25752#issuecomment-1222497773

   > A documentation should be added somewhere (docstring? TaskFlow howto?) to describe what returning True and False means.
   
   That's fair. I think updating the docs somewhere would be my preference. Maybe in the [Python Operator how-tos doc](https://airflow.apache.org/docs/apache-airflow/stable/howto/operator/python.html#howto-operator-shortcircuitoperator)?
   
   Side note, maybe we should add a TaskFlow Decorators section to the [Python API Reference](https://airflow.apache.org/docs/apache-airflow/stable/python-api-ref.html) in a separate PR. WDYT? 


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] uranusjr commented on a diff in pull request #25752: Add ``@task.short_circuit`` TaskFlow decorator

Posted by GitBox <gi...@apache.org>.
uranusjr commented on code in PR #25752:
URL: https://github.com/apache/airflow/pull/25752#discussion_r963992396


##########
docs/apache-airflow/howto/operator/python.rst:
##########
@@ -129,19 +129,18 @@ If you want the context related to datetime objects like ``data_interval_start``
 .. _howto/operator:ShortCircuitOperator:
 
 ShortCircuitOperator
-========================
+====================

Review Comment:
   There is #25319 for this. Maybe add a todo item there?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] josh-fell commented on pull request #25752: Add ``@task.short_circuit`` TaskFlow decorator

Posted by GitBox <gi...@apache.org>.
josh-fell commented on PR #25752:
URL: https://github.com/apache/airflow/pull/25752#issuecomment-1239583286

   Mainly rebasing to pickup #26188 which should hopefully yield clean CI checks.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] josh-fell commented on a diff in pull request #25752: Add ``@task.short_circuit`` TaskFlow decorator

Posted by GitBox <gi...@apache.org>.
josh-fell commented on code in PR #25752:
URL: https://github.com/apache/airflow/pull/25752#discussion_r963976692


##########
docs/apache-airflow/howto/operator/python.rst:
##########
@@ -129,19 +129,18 @@ If you want the context related to datetime objects like ``data_interval_start``
 .. _howto/operator:ShortCircuitOperator:
 
 ShortCircuitOperator
-========================
+====================

Review Comment:
   I thought about it and then didn't to be consistent with the rest of the doc.  Oh but I did forget to add the "warning" block mentioning to use the decorator instead of the classic operator like the others. I'll fix that for sure.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] josh-fell commented on pull request #25752: Add ``@task.short_circuit`` TaskFlow decorator

Posted by GitBox <gi...@apache.org>.
josh-fell commented on PR #25752:
URL: https://github.com/apache/airflow/pull/25752#issuecomment-1238435081

   The test failures don't look related to this PR, but they do look to be resolved by reverting #26175 (at least locally).


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] josh-fell commented on a diff in pull request #25752: Add ``@task.short_circuit`` TaskFlow decorator

Posted by GitBox <gi...@apache.org>.
josh-fell commented on code in PR #25752:
URL: https://github.com/apache/airflow/pull/25752#discussion_r964067242


##########
docs/apache-airflow/howto/operator/python.rst:
##########
@@ -129,19 +129,18 @@ If you want the context related to datetime objects like ``data_interval_start``
 .. _howto/operator:ShortCircuitOperator:
 
 ShortCircuitOperator
-========================
+====================

Review Comment:
   Solid plan to me.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] uranusjr commented on pull request #25752: Add ``@task.short_circuit`` TaskFlow decorator

Posted by GitBox <gi...@apache.org>.
uranusjr commented on PR #25752:
URL: https://github.com/apache/airflow/pull/25752#issuecomment-1219788154

   A documentation should be added somewhere (docstring? TaskFlow howto?) to describe what returning True and False means.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org