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/08/02 03:09:29 UTC

[GitHub] [airflow] potiuk commented on a change in pull request #10078: Add migration guide for CLI commands

potiuk commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r464024677



##########
File path: UPDATING.md
##########
@@ -69,61 +69,86 @@ More tips can be found in the guide:
 https://developers.google.com/style/inclusive-documentation
 
 -->
-### CLI changes
+### CLI changes in Airflow 2.0
 
 The Airflow CLI has been organized so that related commands are grouped together as subcommands,
 which means that if you use these commands in your scripts, you have to make changes to them.
 
 This section describes the changes that have been made, and what you need to do to update your script.
 
-#### Simplification of CLI commands
+The ability to manipulate users from the command line has been changed. ``airflow create_user``,  ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`.
 
-The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`.
+The `airflow list_dags` command is now `airflow dags list`, `airflow pause` is `airflow dags pause`, etc.
 
-Example Usage:
+In Airflow 1.10 and 2.0 there is an `airflow config` command but there is a difference in behavior. In Airflow 1.10,
+it prints all config options while in Airflow 2.0, it's a command group. `airflow config` is now `airflow config list`.
+You can check other options by running the command `airflow config --help`
+
+For a complete list of updated CLI commands, see https://airflow.apache.org/cli.html.
+
+You can learn about the commands by running ``airflow --help``. For example to get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+| Old command                 | New command                        |     Group          |
+|-----------------------------|------------------------------------|--------------------|
+| ``airflow worker``          | ``airflow celery worker``          |    ``celery``      |
+| ``airflow flower``          | ``airflow celery flower``          |    ``celery``      |
+| ``airflow trigger_dag``     | ``airflow dags trigger``           |    ``dags``        |
+| ``airflow delete_dag``      | ``airflow dags delete``            |    ``dags``        |
+| ``airflow show_dag``        | ``airflow dags show``              |    ``dags``        |
+| ``airflow list_dag``        | ``airflow dags list``              |    ``dags``        |
+| ``airflow dag_status``      | ``airflow dags status``            |    ``dags``        |
+| ``airflow backfill``        | ``airflow dags backfill``          |    ``dags``        |
+| ``airflow list_dag_runs``   | ``airflow dags list_runs``         |    ``dags``        |
+| ``airflow pause``           | ``airflow dags pause``             |    ``dags``        |
+| ``airflow unpause``         | ``airflow dags unpause``           |    ``dags``        |
+| ``airflow test``            | ``airflow tasks test``             |    ``tasks``       |
+| ``airflow clear``           | ``airflow tasks clear``            |    ``tasks``       |
+| ``airflow list_tasks``      | ``airflow tasks list``             |    ``tasks``       |
+| ``airflow task_failed_deps``| ``airflow tasks failed_deps``      |    ``tasks``       |
+| ``airflow task_state``      | ``airflow tasks state``            |    ``tasks``       |
+| ``airflow run``             | ``airflow tasks run``              |    ``tasks``       |
+| ``airflow render``          | ``airflow tasks render``           |    ``tasks``       |
+| ``airflow initdb``          | ``airflow db init``                |     ``db``         |
+| ``airflow resetdb``         | ``airflow db reset``               |     ``db``         |
+| ``airflow upgradedb``       | ``airflow db upgrade``             |     ``db``         |
+| ``airflow checkdb``         | ``airflow db check``               |     ``db``         |
+| ``airflow shell``           | ``airflow db shell``               |     ``db``         |
+| ``airflow pool``            | ``airflow pools``                  |     ``pools``      |
+| ``airflow create_user``     | ``airflow users create``           |     ``users``      |
+| ``airflow delete_user``     | ``airflow users delete``           |     ``users``      |
+| ``airflow list_users``      | ``airflow users list``             |     ``users``      |

Review comment:
       I still think we should add "legacy" commands in Airflow CLI to print what is the new command and exit with error. This is a better way of "documenting" it than adding UPDATING.md , Most people will not read the UPDATING.md so we should make it as easy and straightforward for the users to get informed about the new command when they run the old one.
   
   Since we do not have an overlap between the old and new commands it should be rather easy to do (now that we have a table with those commands it should be rather easy. 
   
   Do you plan to do it within this PR @ephraimbuddy @mik-laj? Or as a separate, follow-up 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