You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airflow.apache.org by Vasundhara Auvti <va...@gmail.com> on 2020/09/21 08:14:40 UTC

Enforce Naming Restrictions on DAG_ID

Need help to enforce naming restriction on DAG_ID , i.e. to ensure the
dag_id are following standard naming conventions. such as
DAG_1234_5678_somename.

All airflow users not allowed to create DAG's apart from above convention.

Thanks

Re: Enforce Naming Restrictions on DAG_ID

Posted by Ash Berlin-Taylor <as...@apache.org>.
Docs for cluster policy: http://airflow.apache.org/docs/stable/concepts.html#cluster-policy (http://airflow.apache.org/docs/stable/concepts.html?highlight=policy#cluster-policy)

On Sep 21 2020, at 9:42 am, Tomasz Urbaszek <tu...@apache.org> wrote:
> Hello,
>
> I would either create subclass `MyDAG(DAG)` which validates the dag_id in
> init or use cluster policy to validate it (but this may create too many
> errors). Eventually, you can create test that loads all your dags and
> checks the dag_id. Such test can be run on your CI or before deploying a
> DAG to production.
>
> Best,
> Tomek
>
> On Mon, Sep 21, 2020 at 10:14 AM Vasundhara Auvti <
> vasundhara.auvti@gmail.com> wrote:
>
> > Need help to enforce naming restriction on DAG_ID , i.e. to ensure the
> > dag_id are following standard naming conventions. such as
> > DAG_1234_5678_somename.
> >
> > All airflow users not allowed to create DAG's apart from above convention.
> >
> > Thanks
> >
>


Re: Enforce Naming Restrictions on DAG_ID

Posted by Tomasz Urbaszek <tu...@apache.org>.
Hello,

I would either create subclass `MyDAG(DAG)` which validates the dag_id in
init or use cluster policy to validate it (but this may create too many
errors). Eventually, you can create test that loads all your dags and
checks the dag_id. Such test can be run on your CI or before deploying a
DAG to production.

Best,
Tomek

On Mon, Sep 21, 2020 at 10:14 AM Vasundhara Auvti <
vasundhara.auvti@gmail.com> wrote:

> Need help to enforce naming restriction on DAG_ID , i.e. to ensure the
> dag_id are following standard naming conventions. such as
> DAG_1234_5678_somename.
>
> All airflow users not allowed to create DAG's apart from above convention.
>
> Thanks
>