Skip to content

Commit

Permalink
Add new-style 2.0 command names for Airflow 1.10.x (#12725)
Browse files Browse the repository at this point in the history
This introduces the new style commands for 1.10, but keeps all the
existing commands working, they just don't show in the top level
`airflow --help` anymore.

This was done by taking the argparse groups/sub-commands from master
(along with supporting functions) and copying it here, then providing
needed shims for compat.

I have not added any new sub-commands, nor changed any existing
behaviours, so the 1.10 commands won't change in behaviour.
  • Loading branch information
ashb committed Dec 2, 2020
1 parent fb63fbc commit 5fbd0ed
Show file tree
Hide file tree
Showing 5 changed files with 1,277 additions and 67 deletions.
57 changes: 57 additions & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ assists users migrating to a new version.
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of contents**

- [Airflow 1.10.14](#airflow-11014)
- [Airflow 1.10.13](#airflow-11013)
- [Airflow 1.10.12](#airflow-11012)
- [Airflow 1.10.11](#airflow-11011)
Expand Down Expand Up @@ -61,6 +62,62 @@ More tips can be found in the guide:
https://developers.google.com/style/inclusive-documentation
-->
## Airflow 1.10.14

### Airflow CLI changes in line with 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.

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 `airflow list_dags` command is now `airflow dags list`, `airflow pause` is `airflow dags pause`, etc.

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`

Compatibility with the old CLI has been maintained, but they will no longer appear in the help

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 next_execution`` | ``airflow dags next-execution`` | ``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`` |
| ``airflow rotate_fernet_key`` | ``airflow rotate-fernet-key`` | |
| ``airflow sync_perm`` | ``airflow sync-perm`` | |

## Airflow 1.10.13

### TimeSensor is now timezone aware
Expand Down

0 comments on commit 5fbd0ed

Please sign in to comment.