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/05/30 18:43:22 UTC

[GitHub] [airflow] mik-laj opened a new pull request #9077: Add metavar to CLI arguments

mik-laj opened a new pull request #9077:
URL: https://github.com/apache/airflow/pull/9077


   Before:
   ```
   usage: airflow [-h]
                  {celery,config,connections,dags,db,info,kerberos,pools,roles,rotate_fernet_key,scheduler,sync_perm,tasks,users,variables,version,webserver}
                  ...
   
   positional arguments:
   
     Groups:
       celery              Start celery components. Works only when using
                           CeleryExecutor. For more information, see https://airf
                           low.readthedocs.io/en/stable/executor/celery.html
       connections         List/Add/Delete connections
       dags                List and manage DAGs
       db                  Database operations
       pools               CRUD operations on pools
       roles               Create/List roles
       tasks               List and manage tasks
       users               CRUD operations on users
       variables           CRUD operations on variables
   
     Commands:
       config              Show current application configuration
       info                Show information about current Airflow and environment
       kerberos            Start a kerberos ticket renewer
       rotate_fernet_key   Rotate all encrypted connection credentials and
                           variables; see
                           https://airflow.readthedocs.io/en/stable/howto/secure-
                           connections.html#rotating-encryption-keys
       scheduler           Start a scheduler instance
       sync_perm           Update permissions for existing roles and DAGs
       version             Show the version
       webserver           Start a Airflow webserver instance
   
   optional arguments:
     -h, --help            show this help message and exit
   
   airflow command error: the following arguments are required: subcommand, see help above.
   ```
   After:
   ```
   usage: airflow [-h] GROUP_OR_COMMAND ...
   
   positional arguments:
     GROUP_OR_COMMAND
   
       Groups:
         celery         Start celery components. Works only when using
                        CeleryExecutor. For more information, see https://airflow
                        .readthedocs.io/en/stable/executor/celery.html
         connections    List/Add/Delete connections
         dags           List and manage DAGs
         db             Database operations
         pools          CRUD operations on pools
         roles          Create/List roles
         tasks          List and manage tasks
         users          CRUD operations on users
         variables      CRUD operations on variables
   
       Commands:
         config         Show current application configuration
         info           Show information about current Airflow and environment
         kerberos       Start a kerberos ticket renewer
         rotate_fernet_key
                        Rotate all encrypted connection credentials and
                        variables; see
                        https://airflow.readthedocs.io/en/stable/howto/secure-
                        connections.html#rotating-encryption-keys
         scheduler      Start a scheduler instance
         sync_perm      Update permissions for existing roles and DAGs
         version        Show the version
         webserver      Start a Airflow webserver instance
   
   optional arguments:
     -h, --help         show this help message and exit
   
   airflow command error: the following arguments are required: GROUP_OR_COMMAND, see help above.
   ```
   
   Before:
   ```
   usage: airflow roles [-h] {create,list} ...
   
   positional arguments:
     {create,list}
       create       Create role
       list         List roles
   
   optional arguments:
     -h, --help     show this help message and exit
   ```
   After:
   ```
   usage: airflow roles [-h] COMMNAD ...
   
   positional arguments:
     COMMNAD
       create    Create role
       list      List roles
   
   optional arguments:
     -h, --help  show this help message and exit
   ```
   
   ---
   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] mdediana commented on a change in pull request #9077: Add metavar to CLI arguments

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



##########
File path: airflow/cli/cli_parser.py
##########
@@ -1347,7 +1355,7 @@ def _add_action_command(sub: ActionCommand, sub_proc: argparse.ArgumentParser) -
 
 def _add_group_command(sub: GroupCommand, sub_proc: argparse.ArgumentParser) -> None:
     subcommands = sub.subcommands
-    sub_subparsers = sub_proc.add_subparsers(dest="subcommand")
+    sub_subparsers = sub_proc.add_subparsers(dest="subcommand", metavar="COMMNAD")

Review comment:
       There is a typo here, `COMMNAD`.




----------------------------------------------------------------
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 a change in pull request #9077: Add metavar to CLI arguments

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9077:
URL: https://github.com/apache/airflow/pull/9077#discussion_r432941957



##########
File path: airflow/cli/cli_parser.py
##########
@@ -1347,7 +1355,7 @@ def _add_action_command(sub: ActionCommand, sub_proc: argparse.ArgumentParser) -
 
 def _add_group_command(sub: GroupCommand, sub_proc: argparse.ArgumentParser) -> None:
     subcommands = sub.subcommands
-    sub_subparsers = sub_proc.add_subparsers(dest="subcommand")
+    sub_subparsers = sub_proc.add_subparsers(dest="subcommand", metavar="COMMNAD")

Review comment:
       Thanks! Fixed.




----------------------------------------------------------------
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] potiuk commented on a change in pull request #9077: Add metavar to CLI arguments

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



##########
File path: airflow/cli/cli_parser.py
##########
@@ -1287,6 +1294,7 @@ def _format_action(self, action: Action):
             for subaction in action_subcommnads:
                 parts.append(self._format_action(subaction))
             self._dedent()
+            self._dedent()

Review comment:
       Ah I see now.




----------------------------------------------------------------
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 a change in pull request #9077: Add metavar to CLI arguments

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9077:
URL: https://github.com/apache/airflow/pull/9077#discussion_r432941898



##########
File path: airflow/cli/cli_parser.py
##########
@@ -1347,7 +1355,7 @@ def _add_action_command(sub: ActionCommand, sub_proc: argparse.ArgumentParser) -
 
 def _add_group_command(sub: GroupCommand, sub_proc: argparse.ArgumentParser) -> None:
     subcommands = sub.subcommands
-    sub_subparsers = sub_proc.add_subparsers(dest="subcommand")
+    sub_subparsers = sub_proc.add_subparsers(dest="subcommand", metavar="COMMNAD")

Review comment:
       ```suggestion
       sub_subparsers = sub_proc.add_subparsers(dest="subcommand", metavar="COMMAND")
   ```




----------------------------------------------------------------
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] potiuk commented on a change in pull request #9077: Add metavar to CLI arguments

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



##########
File path: airflow/cli/cli_parser.py
##########
@@ -1287,6 +1294,7 @@ def _format_action(self, action: Action):
             for subaction in action_subcommnads:
                 parts.append(self._format_action(subaction))
             self._dedent()
+            self._dedent()

Review comment:
       Is it good to have one indent and two dedents?




----------------------------------------------------------------
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 merged pull request #9077: Add metavar to CLI arguments

Posted by GitBox <gi...@apache.org>.
mik-laj merged pull request #9077:
URL: https://github.com/apache/airflow/pull/9077


   


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