You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "raphaelauv (via GitHub)" <gi...@apache.org> on 2024/03/15 11:06:09 UTC

[I] constraint "dag_run_dag_id_execution_date_key" not using dag_run [airflow]

raphaelauv opened a new issue, #38176:
URL: https://github.com/apache/airflow/issues/38176

   ### Apache Airflow version
   
   2.8.3
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   I want run multiple dag_run with the same execution date but it fail with
   
   ```log
   sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "dag_run_dag_id_execution_date_key"
   DETAIL:  Key (dag_id, execution_date)=(test_a, 2024-03-01 00:00:00+00) already exists.
   ```
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   ```python
   
   from airflow.operators.python import PythonOperator
   from airflow.operators.trigger_dagrun import TriggerDagRunOperator
   from pendulum import today
   from airflow import DAG
   
   dag = DAG(
       dag_id="test_a",
       schedule_interval=None,
       start_date=today("UTC").add(days=-1000)
   )
   
   with dag:
       def toto(arg_1):
           print(arg_1)
   
       task_2 = PythonOperator(
           task_id="task-two",
           python_callable=toto,
           op_kwargs={"arg_1": "1"})
   
   dag = DAG(
       dag_id="test_b",
       schedule_interval=None,
       start_date=today("UTC").add(days=-1)
   )
   
   with dag:
       TriggerDagRunOperator.partial(
           task_id="aaa",
           trigger_dag_id="test_a",
           reset_dag_run=True,
           wait_for_completion=True,
           deferrable=True
       ).expand_kwargs(
           [{"execution_date": x, "trigger_run_id": y} for x, y in
            [("2024-03-01", "NAME_a"), ("2024-03-01", "NAME_b")]])
   ```
   
   ### Operating System
   
   ubuntu 22.04
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] constraint "dag_run_dag_id_execution_date_key" not using run_id [airflow]

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on issue #38176:
URL: https://github.com/apache/airflow/issues/38176#issuecomment-2331174055

   Now you can run multiple runs with the same date (but different run IDs). Is this still relevant?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] constraint "dag_run_dag_id_execution_date_key" not using run_id [airflow]

Posted by "raphaelauv (via GitHub)" <gi...@apache.org>.
raphaelauv commented on issue #38176:
URL: https://github.com/apache/airflow/issues/38176#issuecomment-2329162110

   https://github.com/apache/airflow/pull/41818


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] constraint "dag_run_dag_id_execution_date_key" not using run_id [airflow]

Posted by "raphaelauv (via GitHub)" <gi...@apache.org>.
raphaelauv closed issue #38176: constraint "dag_run_dag_id_execution_date_key" not using run_id
URL: https://github.com/apache/airflow/issues/38176


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] constraint "dag_run_dag_id_execution_date_key" not using run_id [airflow]

Posted by "hussein-awala (via GitHub)" <gi...@apache.org>.
hussein-awala commented on issue #38176:
URL: https://github.com/apache/airflow/issues/38176#issuecomment-2000603997

   Check https://github.com/apache/airflow/pull/38179#issuecomment-2000603769


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] constraint "dag_run_dag_id_execution_date_key" not using run_id [airflow]

Posted by "raphaelauv (via GitHub)" <gi...@apache.org>.
raphaelauv commented on issue #38176:
URL: https://github.com/apache/airflow/issues/38176#issuecomment-2331268501

   if `Now you can run multiple runs with the same date (but different run IDs)` then yes I can close this issue
   
   also @uranusjr can we run with a None/NULL execution date ? 
   
   (I have dags where the a dag_run is not related to a date)


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org