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/06/27 18:33:02 UTC

[GitHub] [airflow] kaxil opened a new pull request #9550: Enable Black - Python Auto Formmatter

kaxil opened a new pull request #9550:
URL: https://github.com/apache/airflow/pull/9550


   Enable Black using pre-commit 
   
   ---
   
   Make sure to mark the boxes below before creating PR: [x]
   
   - [x] Description above provides context of the change
   - [x] Unit tests coverage for changes (not needed for documentation changes)
   - [x] Target Github ISSUE in description if exists
   - [x] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   - [x] Relevant documentation is updated including usage instructions.
   - [x] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
   
   ---
   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).
   Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
   


----------------------------------------------------------------
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 #9550: Enable Black - Python Auto Formmatter

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


   > Have you considered enabling the "--skip-string-normalization" option? This should reduce the number of changes without compromising the readability of the code.
   > 
   > ```
   >   -S, --skip-string-normalization
   >                                   Don't normalize string quotes or prefixes.
   > ```
   > 
   > Thanks to this, we will only have whitespace changes.
   
   Applied


----------------------------------------------------------------
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 #9550: Enable Black - Python Auto Formmatter

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



##########
File path: .pre-commit-config.yaml
##########
@@ -159,8 +159,7 @@ repos:
     rev: 20.8b1
     hooks:
       - id: black
-        files: api_connexion/.*\.py|.*providers.*\.py|^chart/tests/.*\.py
-        exclude: .*kubernetes_pod\.py|.*google/common/hooks/base_google\.py$
+        exclude: .*kubernetes_pod\.py|.*google/common/hooks/base_google\.py$|^airflow/configuration.py$

Review comment:
       Yes, black had issues with it i.e. it couldn't reproduce the same file pre and post black so it would be good to ignore them for now
   
   ```
   ❯ pre-commit run black -a
   black....................................................................Failed
   - hook id: black
   - exit code: 123
   
   error: cannot format /Users/kaxilnaik/Documents/Github/astronomer/airflow/airflow/configuration.py: INTERNAL ERROR: Black produced different code on the second pass of the formatter.  Please report a bug on https://github.com/psf/black/issues.  This diff might be helpful: /var/folders/jk/z68c_8nd1w5ggdc51r5zhnxm0000gn/T/blk_madaodvm.log
   Oh no! 💥 💔 💥
   2548 files left unchanged, 1 file failed to reformat.
   ```




----------------------------------------------------------------
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 merged pull request #9550: Enable Black - Python Auto Formmatter

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


   


----------------------------------------------------------------
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 #9550: Enable Black - Python Auto Formmatter

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


   [The Workflow run](https://github.com/apache/airflow/actions/runs/343658135) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


----------------------------------------------------------------
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 #9550: Enable Black - Python Auto Formmatter

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


   Do you guys have any opinion if we should delay "Black" or do it now?
   
   We can also enable this on `v1-10-test`. so shouldn't make backporting difficult.
   
   


----------------------------------------------------------------
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 #9550: Enable Black - Python Auto Formmatter

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



##########
File path: .pre-commit-config.yaml
##########
@@ -159,8 +159,7 @@ repos:
     rev: 20.8b1
     hooks:
       - id: black
-        files: api_connexion/.*\.py|.*providers.*\.py|^chart/tests/.*\.py
-        exclude: .*kubernetes_pod\.py|.*google/common/hooks/base_google\.py$
+        exclude: .*kubernetes_pod\.py|.*google/common/hooks/base_google\.py$|^airflow/configuration.py$

Review comment:
       Yes, black had issues with it:
   
   ```
   ❯ pre-commit run black -a
   black....................................................................Failed
   - hook id: black
   - exit code: 123
   
   error: cannot format /Users/kaxilnaik/Documents/Github/astronomer/airflow/airflow/configuration.py: INTERNAL ERROR: Black produced different code on the second pass of the formatter.  Please report a bug on https://github.com/psf/black/issues.  This diff might be helpful: /var/folders/jk/z68c_8nd1w5ggdc51r5zhnxm0000gn/T/blk_madaodvm.log
   Oh no! 💥 💔 💥
   2548 files left unchanged, 1 file failed to reformat.
   ```




----------------------------------------------------------------
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 #9550: Enable Black - Python Auto Formmatter

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



##########
File path: .pre-commit-config.yaml
##########
@@ -159,8 +159,7 @@ repos:
     rev: 20.8b1
     hooks:
       - id: black
-        files: api_connexion/.*\.py|.*providers.*\.py|^chart/tests/.*\.py
-        exclude: .*kubernetes_pod\.py|.*google/common/hooks/base_google\.py$
+        exclude: .*kubernetes_pod\.py|.*google/common/hooks/base_google\.py$|^airflow/configuration.py$

Review comment:
       Any reason for this exclude? 




----------------------------------------------------------------
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] mik-laj commented on pull request #9550: Enable Black - Python Auto Formmatter

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #9550:
URL: https://github.com/apache/airflow/pull/9550#issuecomment-650971650


   Have you considered enabling the "--skip-string-normalization" option? This should reduce the number of changes without compromising the readability of the code.
   ```
     -S, --skip-string-normalization
                                     Don't normalize string quotes or prefixes.
   ```


----------------------------------------------------------------
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 #9550: Enable Black - Python Auto Formmatter

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


   The first commit contains the configuration only: https://github.com/apache/airflow/pull/9550/commits/29e19fa670077eb10eefb9e418e6b45d5acb6a40
   
   The 2nd commit actually applies `black`: https://github.com/apache/airflow/pull/9550/commits/bcbcc4d14


----------------------------------------------------------------
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] stale[bot] commented on pull request #9550: Enable Black - Python Auto Formmatter

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


   This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
   


----------------------------------------------------------------
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] stale[bot] removed a comment on pull request #9550: Enable Black - Python Auto Formmatter

Posted by GitBox <gi...@apache.org>.
stale[bot] removed a comment on pull request #9550:
URL: https://github.com/apache/airflow/pull/9550#issuecomment-683255367


   This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
   


----------------------------------------------------------------
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 #9550: Enable Black - Python Auto Formmatter

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


   [The Build Workflow run](https://github.com/apache/airflow/actions/runs/294177785) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks$,^Build docs$,^Spell check docs$,^Backport packages$,^Checks: Helm tests$,^Test OpenAPI*.


----------------------------------------------------------------
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 #9550: Enable Black - Python Auto Formmatter

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


   The first commit contains the configuration only: https://github.com/apache/airflow/pull/9550/commits/29e19fa670077eb10eefb9e418e6b45d5acb6a40
   
   The 2nd commit actually applies `black`


----------------------------------------------------------------
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 #9550: Enable Black - Python Auto Formmatter

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



##########
File path: .pre-commit-config.yaml
##########
@@ -159,8 +159,7 @@ repos:
     rev: 20.8b1
     hooks:
       - id: black
-        files: api_connexion/.*\.py|.*providers.*\.py|^chart/tests/.*\.py
-        exclude: .*kubernetes_pod\.py|.*google/common/hooks/base_google\.py$
+        exclude: .*kubernetes_pod\.py|.*google/common/hooks/base_google\.py$|^airflow/configuration.py$

Review comment:
       Interesting 👀 




----------------------------------------------------------------
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 #9550: Enable Black - Python Auto Formmatter

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


   The PR needs to run all tests because it modifies core of Airflow! Please rebase it to latest master or ask committer to re-run it!


----------------------------------------------------------------
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 #9550: Enable Black - Python Auto Formmatter

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


   The first commit contains the configuration only: https://github.com/apache/airflow/pull/9550/commits/29e19fa670077eb10eefb9e418e6b45d5acb6a40
   
   The 2nd commit actually applies `black`: https://github.com/apache/airflow/pull/9550/commits/8c5e313b0da043c671df41d9ac851eed0dc92a6d


----------------------------------------------------------------
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 #9550: Enable Black - Python Auto Formmatter

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


   The first commit contains the configuration only: https://github.com/apache/airflow/pull/9550/commits/29e19fa670077eb10eefb9e418e6b45d5acb6a40
   
   The 2nd commit actually applies `black`: https://github.com/apache/airflow/pull/9550/commits/9bdaf18f7


----------------------------------------------------------------
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] mik-laj edited a comment on pull request #9550: Enable Black - Python Auto Formmatter

Posted by GitBox <gi...@apache.org>.
mik-laj edited a comment on pull request #9550:
URL: https://github.com/apache/airflow/pull/9550#issuecomment-650971650


   Have you considered enabling the "--skip-string-normalization" option? This should reduce the number of changes without compromising the readability of the code.
   ```
     -S, --skip-string-normalization
                                     Don't normalize string quotes or prefixes.
   ```
   Thanks to this, we will only have whitespace changes.


----------------------------------------------------------------
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 #9550: Enable Black - Python Auto Formmatter

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


   The first commit contains the configuration only: https://github.com/apache/airflow/pull/9550/commits/29e19fa670077eb10eefb9e418e6b45d5acb6a40
   
   The 2nd commit actually applies `black`: https://github.com/apache/airflow/pull/9550/commits/48f62a236


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