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 2020/12/06 22:54:04 UTC

[GitHub] [airflow] ashb opened a new pull request #12868: Store per-task TIDeps in serialized blob

ashb opened a new pull request #12868:
URL: https://github.com/apache/airflow/pull/12868


   Without this change sensors in "reschedule" mode were being instantly
   rescheduled because they didn't have the extra dep that
   BaseSensorOperator added.
   
   To fix that we need to include deps in the serialization format (but to
   save space only when they are not the default list). As of this PR right
   now, only built-in deps are allowed -- a custom dep will result in a DAG
   parse error.
   
   We can fix that for 2.0.x, as I think it is a _very_ uncommon thing to
   do.
   
   Fixes #12783
   
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+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 [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).


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

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



[GitHub] [airflow] kaxil commented on a change in pull request #12868: Refactor `@provide_session` to do less "at runtime"

Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #12868:
URL: https://github.com/apache/airflow/pull/12868#discussion_r537147365



##########
File path: airflow/utils/session.py
##########
@@ -46,20 +46,23 @@ def provide_session(func: Callable[..., RT]) -> Callable[..., RT]:
     database transaction, you pass it to the function, if not this wrapper
     will create one and close it for you.
     """
+    func_params = func.__code__.co_varnames

Review comment:
       Won't this be still called everytime `provide_session` decorator is called?




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

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



[GitHub] [airflow] ashb merged pull request #12868: Refactor `@provide_session` to do less "at runtime"

Posted by GitBox <gi...@apache.org>.
ashb merged pull request #12868:
URL: https://github.com/apache/airflow/pull/12868


   


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

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



[GitHub] [airflow] kaxil commented on pull request #12868: Refactor `@provide_session` to do less "at runtime"

Posted by GitBox <gi...@apache.org>.
kaxil commented on pull request #12868:
URL: https://github.com/apache/airflow/pull/12868#issuecomment-739579376


   For some reason the PR title and commit message are from your other closed PR


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

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



[GitHub] [airflow] github-actions[bot] commented on pull request #12868: Refactor `@provide_session` to do less "at runtime"

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #12868:
URL: https://github.com/apache/airflow/pull/12868#issuecomment-739585111


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


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

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



[GitHub] [airflow] ashb edited a comment on pull request #12868: Refactor `@provide_session` to do less "at runtime"

Posted by GitBox <gi...@apache.org>.
ashb edited a comment on pull request #12868:
URL: https://github.com/apache/airflow/pull/12868#issuecomment-739581054


   Git fail.
   
   @kaxil Updated, thanks.


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

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



[GitHub] [airflow] ashb commented on a change in pull request #12868: Refactor `@provide_session` to do less "at runtime"

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #12868:
URL: https://github.com/apache/airflow/pull/12868#discussion_r537148859



##########
File path: airflow/utils/session.py
##########
@@ -46,20 +46,23 @@ def provide_session(func: Callable[..., RT]) -> Callable[..., RT]:
     database transaction, you pass it to the function, if not this wrapper
     will create one and close it for you.
     """
+    func_params = func.__code__.co_varnames

Review comment:
       This will be called only where the decorator is used, not every time the _Function_ is called
   




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

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



[GitHub] [airflow] ashb commented on pull request #12868: Refactor `@provide_session` to do less "at runtime"

Posted by GitBox <gi...@apache.org>.
ashb commented on pull request #12868:
URL: https://github.com/apache/airflow/pull/12868#issuecomment-739581054


   Git fail.


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

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



[GitHub] [airflow] ashb commented on a change in pull request #12868: Refactor `@provide_session` to do less "at runtime"

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #12868:
URL: https://github.com/apache/airflow/pull/12868#discussion_r537148859



##########
File path: airflow/utils/session.py
##########
@@ -46,20 +46,23 @@ def provide_session(func: Callable[..., RT]) -> Callable[..., RT]:
     database transaction, you pass it to the function, if not this wrapper
     will create one and close it for you.
     """
+    func_params = func.__code__.co_varnames

Review comment:
       This will be called only where the decorator is used, not every time the _function_ is called.
   
   Only code in the `wrapper` is called each time the wrapped-function is called. (And we make use of the fact wrapper is a closure to locallize the session_args_idx param to each function sig.)
   




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

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



[GitHub] [airflow] ashb commented on pull request #12868: Refactor `@provide_session` to do less "at runtime"

Posted by GitBox <gi...@apache.org>.
ashb commented on pull request #12868:
URL: https://github.com/apache/airflow/pull/12868#issuecomment-739845046


   I changed this to use `inspect.signature()` as that copes with wrapped functions better. Still done at "parse" time, not runtime.


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

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



[GitHub] [airflow] kaxil edited a comment on pull request #12868: Refactor `@provide_session` to do less "at runtime"

Posted by GitBox <gi...@apache.org>.
kaxil edited a comment on pull request #12868:
URL: https://github.com/apache/airflow/pull/12868#issuecomment-739579376


   For some reason the PR title and description are from your other closed PR


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

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