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 2021/01/04 11:47:59 UTC

[GitHub] [airflow] turbaszek opened a new pull request #13458: Log migrations info in consistent way

turbaszek opened a new pull request #13458:
URL: https://github.com/apache/airflow/pull/13458


   Resource based permissions migration changes logging handlers
   so each next migration is differently formatted when doing
   airflow db reset. This commit fixes this behavior.
   
   closes: #13214
   
   Before:
   <img width="1359" alt="Screenshot 2021-01-04 at 12 46 05" src="https://user-images.githubusercontent.com/9528307/103532036-d0c5a800-4e8a-11eb-829a-9d0270b96a29.png">
   
   
   After:
   <img width="1359" alt="Screenshot 2021-01-04 at 12 46 49" src="https://user-images.githubusercontent.com/9528307/103532098-eaff8600-4e8a-11eb-9fba-2de69abfc07b.png">
   
   
   ---
   **^ 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] github-actions[bot] commented on pull request #13458: Log migrations info in consistent way

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


   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] jhtimmins commented on pull request #13458: Log migrations info in consistent way

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


   Looks good @turbaszek!


----------------------------------------------------------------
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 #13458: Log migrations info in consistent way

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



##########
File path: airflow/migrations/versions/2c6edca13270_resource_based_permissions.py
##########
@@ -307,7 +309,10 @@ def remap_permissions():
 
 def upgrade():
     """Apply Resource based permissions."""
+    log = logging.getLogger()
+    handlers = log.handlers[:]

Review comment:
       However, I am fine with this too -- doesn't hurt 😉 




----------------------------------------------------------------
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 #13458: Log migrations info in consistent way

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



##########
File path: airflow/migrations/versions/2c6edca13270_resource_based_permissions.py
##########
@@ -307,7 +309,10 @@ def remap_permissions():
 
 def upgrade():
     """Apply Resource based permissions."""
+    log = logging.getLogger()
+    handlers = log.handlers[:]

Review comment:
       `airflow db upgrade` will run in a separate process so I don't think it might cause any issue.
   
   




----------------------------------------------------------------
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 #13458: Log migrations info in consistent way

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



##########
File path: airflow/migrations/versions/2c6edca13270_resource_based_permissions.py
##########
@@ -307,7 +309,10 @@ def remap_permissions():
 
 def upgrade():
     """Apply Resource based permissions."""
+    log = logging.getLogger()
+    handlers = log.handlers[:]

Review comment:
       ```suggestion
       handlers = log.handlers
   ```




----------------------------------------------------------------
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] turbaszek commented on pull request #13458: Log migrations info in consistent way

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


   CC @jhtimmins 


----------------------------------------------------------------
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] turbaszek commented on pull request #13458: Log migrations info in consistent way

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


   We may consider redirecting airflow specific logs (not related to migrations, you may see them at the end of both screenshots) to other stream and print them only if there's error / verbose flag.


----------------------------------------------------------------
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] turbaszek commented on a change in pull request #13458: Log migrations info in consistent way

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



##########
File path: airflow/migrations/versions/2c6edca13270_resource_based_permissions.py
##########
@@ -307,7 +309,10 @@ def remap_permissions():
 
 def upgrade():
     """Apply Resource based permissions."""
+    log = logging.getLogger()
+    handlers = log.handlers[:]

Review comment:
       Won't it get mutated? I wanted to make a deep copy to avoid situation that we had some time ago in Airflow with handlers 😄  




----------------------------------------------------------------
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] turbaszek merged pull request #13458: Log migrations info in consistent way

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


   


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