You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Anton Kumpan (Jira)" <ji...@apache.org> on 2019/10/04 00:46:00 UTC

[jira] [Updated] (AIRFLOW-5593) Utilize 'run_id' instead of 'execution_date' as dag_runs unique identifier for Rest APIs

     [ https://issues.apache.org/jira/browse/AIRFLOW-5593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anton Kumpan updated AIRFLOW-5593:
----------------------------------
    Description: 
When we are triggering DAG with POST:
{code:java}
POST /api/experimental/dags/<DAG_ID>/dag_runs{code}
we can assign unique 'run_id' for the run.

But after it - we are still forced to use *'execution_date'* as a parameter to work with the run, e.g: GET: /dags/<string:dag_id>/dag_runs/<*string:execution_date*> - expects *execution_date.*

This is not very comfortable and forces user to mandatory operate with dates instead of working with unique ID which can be any string.

We already have a unique constraint in DagRun:
{code:java}
UniqueConstraint('dag_id', 'run_id')
{code}
 

*Affected areas:*

Currently - 'execution_date' is used for following Rest API:
{code:java}
GET /api/experimental/dags/<string:dag_id>/dag_runs/<string:execution_date>{code}
{code:java}
GET /api/experimental/dags/<DAG_ID>/dag_runs/<string:execution_date>/tasks/<TASK_ID>
{code}
 

I propose to change these endpoints to utilize *'run_id'* instead of *'execution_date'*, so these API will became:
{code:java}
GET /api/experimental/dags/<string:dag_id>/dag_runs/<string:run_id>{code}
{code:java}
GET /api/experimental/dags/<DAG_ID>/dag_runs/<string:run_id>/tasks/<TASK_ID>
{code}
 

AIRFLOW-5590 - logged to return  *'run_id'* as a separate field in the response.

 

 

  was:
When we are triggering DAG with POST:

 
{code:java}
POST /api/experimental/dags/<DAG_ID>/dag_runs{code}
 

we can assign unique 'run_id' for the run.

But after it - we are still forced to use *'execution_date'* as a parameter to work with the run, e.g: GET: /dags/<string:dag_id>/dag_runs/<*string:execution_date*> - expects *execution_date.*

This is not very comfortable and forces user to mandatory operate with dates instead of working with unique ID which can be any string.

We already have a unique constraint in DagRun:

 
{code:java}
UniqueConstraint('dag_id', 'run_id')
{code}
 

*Affected areas:*

Currently - 'execution_date' is used for following Rest API:
{code:java}
GET /api/experimental/dags/<string:dag_id>/dag_runs/<string:execution_date>{code}
{code:java}
GET /api/experimental/dags/<DAG_ID>/dag_runs/<string:execution_date>/tasks/<TASK_ID>
{code}
 

I propose to change these endpoints to utilize *'run_id'* instead of *'execution_date'*, so these API will became:
{code:java}
GET /api/experimental/dags/<string:dag_id>/dag_runs/<string:run_id>{code}
{code:java}
GET /api/experimental/dags/<DAG_ID>/dag_runs/<string:run_id>/tasks/<TASK_ID>
{code}
 

AIRFLOW-5590 - logged to return  *'run_id'* as a separate field in the response.

 

 


> Utilize 'run_id' instead of 'execution_date' as dag_runs unique identifier for Rest APIs
> ----------------------------------------------------------------------------------------
>
>                 Key: AIRFLOW-5593
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5593
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: api
>    Affects Versions: 1.10.5
>            Reporter: Anton Kumpan
>            Assignee: Anton Kumpan
>            Priority: Major
>
> When we are triggering DAG with POST:
> {code:java}
> POST /api/experimental/dags/<DAG_ID>/dag_runs{code}
> we can assign unique 'run_id' for the run.
> But after it - we are still forced to use *'execution_date'* as a parameter to work with the run, e.g: GET: /dags/<string:dag_id>/dag_runs/<*string:execution_date*> - expects *execution_date.*
> This is not very comfortable and forces user to mandatory operate with dates instead of working with unique ID which can be any string.
> We already have a unique constraint in DagRun:
> {code:java}
> UniqueConstraint('dag_id', 'run_id')
> {code}
>  
> *Affected areas:*
> Currently - 'execution_date' is used for following Rest API:
> {code:java}
> GET /api/experimental/dags/<string:dag_id>/dag_runs/<string:execution_date>{code}
> {code:java}
> GET /api/experimental/dags/<DAG_ID>/dag_runs/<string:execution_date>/tasks/<TASK_ID>
> {code}
>  
> I propose to change these endpoints to utilize *'run_id'* instead of *'execution_date'*, so these API will became:
> {code:java}
> GET /api/experimental/dags/<string:dag_id>/dag_runs/<string:run_id>{code}
> {code:java}
> GET /api/experimental/dags/<DAG_ID>/dag_runs/<string:run_id>/tasks/<TASK_ID>
> {code}
>  
> AIRFLOW-5590 - logged to return  *'run_id'* as a separate field in the response.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)