You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/02/23 07:20:40 UTC
[GitHub] [airflow] mik-laj edited a comment on issue #7502:
[AIRFLOW-6881][depends on AIRFLOW-6869][WIP] Bulk fetch DAGRun for
create_dag_run
mik-laj edited a comment on issue #7502: [AIRFLOW-6881][depends on AIRFLOW-6869][WIP] Bulk fetch DAGRun for create_dag_run
URL: https://github.com/apache/airflow/pull/7502#issuecomment-589997296
```python
from datetime import timedelta
from airflow.models import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.utils.dates import days_ago
args = {
'owner': 'airflow',
'start_date': days_ago(3),
}
def create_dag(dag_number):
dag = DAG(
dag_id=f'perf_50_dag_dummy_tasks_{dag_number}_of_50', default_args=args,
schedule_interval="@once",
dagrun_timeout=timedelta(minutes=60),
is_paused_upon_creation=False,
)
for j in range(1, 100):
DummyOperator(
task_id='task_{}_of_5'.format(j),
dag=dag
)
return dag
for i in range(1, 20):
globals()[f"dag_{i}"] = create_dag(i)
```
Before:
Query count: 249
Retry took 1333.755 ms
After:
Query count: 230
Retry took 1267.842 ms
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services