You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airflow.apache.org by hotmail <zh...@hotmail.com> on 2020/01/16 02:39:49 UTC

[DISCUSS] Airflow cli option style

Hi everyone, I create a PR for our cli option in https://github.com/apache/airflow/pull/7148 <https://github.com/apache/airflow/pull/7148>
The initial purpose is change our cli short option to exactly single character, and PR already
did it as follow

| Old command                                        | New command                                       |
|----------------------------------------------------|---------------------------------------------------|
| ``airflow (dags|tasks|scheduler) [-sd, --subdir]`` | ``airflow (dags|tasks|scheduler) [-S, --subdir]`` |
| ``airflow tasks test [-dr, --dry_run]``            | ``airflow tasks test [-dr, --dry_run]``           |
| ``airflow dags backfill [-dr, --dry_run]``         | ``airflow dags backfill [-n, --dry_run]``         |
| ``airflow tasks clear [-dx, --dag_regex]``         | ``airflow tasks clear [-R, --dag_regex]``         |
| ``airflow kerberos [-kt, --keytab]``               | ``airflow kerberos [-k, --keytab]``               |
| ``airflow tasks run [-int, --interactive]``        | ``airflow tasks run [-N, --interactive]``         |
| ``airflow webserver [-hn, --hostname]``            | ``airflow webserver [-H, --hostname]``            |
| ``airflow celery worker [-cn, --celery_hostname]`` | ``airflow celery worker [-H, --celery_hostname]`` |
| ``airflow celery flower [-hn, --hostname]``        | ``airflow celery flower [-H, --hostname]``        |
| ``airflow celery flower [-fc, --flower_conf]``     | ``airflow celery flower [-c, --flower_conf]``     |

The first thing I want to discuss here:
* It's the new command make sence?
* Should we keep short option unique in airflow command? or just unique for each subcommand?(only unique in `airflow tasks run`)

Further more, I proposal change our long option name style from `snake_case` to `kebab-case`, for example using
`airflow tasks test --dry-run` instead of `airflow tasks test --dry_run`, cause I find out many unix command line
use kebab-case instead of snake_case


Best Wish
— Jiajie




Re: [DISCUSS] Airflow cli option style

Posted by Kaxil Naik <ka...@gmail.com>.
Thanks Jiajie, that looks great

On Fri, Feb 28, 2020 at 2:59 AM Jiajie Zhong <zh...@hotmail.com>
wrote:

> Hey guys, I add some code on it and finally pass Travis-CI, maybe you
> could task a look at https://github.com/apache/airflow/pull/7148 <
> https://github.com/apache/airflow/pull/7148>
> Best Wish
> — Jiajie
>
>

Re: [DISCUSS] Airflow cli option style

Posted by Jiajie Zhong <zh...@hotmail.com>.
Hey guys, I add some code on it and finally pass Travis-CI, maybe you could task a look at https://github.com/apache/airflow/pull/7148 <https://github.com/apache/airflow/pull/7148>
Best Wish
— Jiajie


Re: [DISCUSS] Airflow cli option style

Posted by Kaxil Naik <ka...@gmail.com>.
Let the discussion remain open a little longer. I haven't yet read much
details but is in my "todo" list.

On Thu, Jan 16, 2020 at 4:43 PM Jarek Potiuk <Ja...@polidea.com>
wrote:

> I really like the consistency - and especially that you added tests that
> maintain the consistency forward :)
> I am all for the change - just a few comments in the PR.
>
> J.
>
> On Thu, Jan 16, 2020 at 3:40 AM hotmail <zh...@hotmail.com>
> wrote:
>
> > Hi everyone, I create a PR for our cli option in
> > https://github.com/apache/airflow/pull/7148 <
> > https://github.com/apache/airflow/pull/7148>
> > The initial purpose is change our cli short option to exactly single
> > character, and PR already
> > did it as follow
> >
> > | Old command                                        | New command
> >                                |
> >
> >
> |----------------------------------------------------|---------------------------------------------------|
> > | ``airflow (dags|tasks|scheduler) [-sd, --subdir]`` | ``airflow
> > (dags|tasks|scheduler) [-S, --subdir]`` |
> > | ``airflow tasks test [-dr, --dry_run]``            | ``airflow tasks
> > test [-dr, --dry_run]``           |
> > | ``airflow dags backfill [-dr, --dry_run]``         | ``airflow dags
> > backfill [-n, --dry_run]``         |
> > | ``airflow tasks clear [-dx, --dag_regex]``         | ``airflow tasks
> > clear [-R, --dag_regex]``         |
> > | ``airflow kerberos [-kt, --keytab]``               | ``airflow kerberos
> > [-k, --keytab]``               |
> > | ``airflow tasks run [-int, --interactive]``        | ``airflow tasks
> run
> > [-N, --interactive]``         |
> > | ``airflow webserver [-hn, --hostname]``            | ``airflow
> webserver
> > [-H, --hostname]``            |
> > | ``airflow celery worker [-cn, --celery_hostname]`` | ``airflow celery
> > worker [-H, --celery_hostname]`` |
> > | ``airflow celery flower [-hn, --hostname]``        | ``airflow celery
> > flower [-H, --hostname]``        |
> > | ``airflow celery flower [-fc, --flower_conf]``     | ``airflow celery
> > flower [-c, --flower_conf]``     |
> >
> > The first thing I want to discuss here:
> > * It's the new command make sence?
> > * Should we keep short option unique in airflow command? or just unique
> > for each subcommand?(only unique in `airflow tasks run`)
> >
> > Further more, I proposal change our long option name style from
> > `snake_case` to `kebab-case`, for example using
> > `airflow tasks test --dry-run` instead of `airflow tasks test --dry_run`,
> > cause I find out many unix command line
> > use kebab-case instead of snake_case
> >
> >
> > Best Wish
> > — Jiajie
> >
> >
> >
> >
>
> --
>
> Jarek Potiuk
> Polidea <https://www.polidea.com/> | Principal Software Engineer
>
> M: +48 660 796 129 <+48660796129>
> [image: Polidea] <https://www.polidea.com/>
>

Re: [DISCUSS] Airflow cli option style

Posted by Jarek Potiuk <Ja...@polidea.com>.
I really like the consistency - and especially that you added tests that
maintain the consistency forward :)
I am all for the change - just a few comments in the PR.

J.

On Thu, Jan 16, 2020 at 3:40 AM hotmail <zh...@hotmail.com> wrote:

> Hi everyone, I create a PR for our cli option in
> https://github.com/apache/airflow/pull/7148 <
> https://github.com/apache/airflow/pull/7148>
> The initial purpose is change our cli short option to exactly single
> character, and PR already
> did it as follow
>
> | Old command                                        | New command
>                                |
>
> |----------------------------------------------------|---------------------------------------------------|
> | ``airflow (dags|tasks|scheduler) [-sd, --subdir]`` | ``airflow
> (dags|tasks|scheduler) [-S, --subdir]`` |
> | ``airflow tasks test [-dr, --dry_run]``            | ``airflow tasks
> test [-dr, --dry_run]``           |
> | ``airflow dags backfill [-dr, --dry_run]``         | ``airflow dags
> backfill [-n, --dry_run]``         |
> | ``airflow tasks clear [-dx, --dag_regex]``         | ``airflow tasks
> clear [-R, --dag_regex]``         |
> | ``airflow kerberos [-kt, --keytab]``               | ``airflow kerberos
> [-k, --keytab]``               |
> | ``airflow tasks run [-int, --interactive]``        | ``airflow tasks run
> [-N, --interactive]``         |
> | ``airflow webserver [-hn, --hostname]``            | ``airflow webserver
> [-H, --hostname]``            |
> | ``airflow celery worker [-cn, --celery_hostname]`` | ``airflow celery
> worker [-H, --celery_hostname]`` |
> | ``airflow celery flower [-hn, --hostname]``        | ``airflow celery
> flower [-H, --hostname]``        |
> | ``airflow celery flower [-fc, --flower_conf]``     | ``airflow celery
> flower [-c, --flower_conf]``     |
>
> The first thing I want to discuss here:
> * It's the new command make sence?
> * Should we keep short option unique in airflow command? or just unique
> for each subcommand?(only unique in `airflow tasks run`)
>
> Further more, I proposal change our long option name style from
> `snake_case` to `kebab-case`, for example using
> `airflow tasks test --dry-run` instead of `airflow tasks test --dry_run`,
> cause I find out many unix command line
> use kebab-case instead of snake_case
>
>
> Best Wish
> — Jiajie
>
>
>
>

-- 

Jarek Potiuk
Polidea <https://www.polidea.com/> | Principal Software Engineer

M: +48 660 796 129 <+48660796129>
[image: Polidea] <https://www.polidea.com/>