You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2021/07/26 11:16:37 UTC

[airflow] branch main updated: Remove/refactor default_args pattern for Microsoft example DAGs (#16873)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 48ca937  Remove/refactor default_args pattern for Microsoft example DAGs (#16873)
48ca937 is described below

commit 48ca9374bfe4a0784b5eb9ec74c1e3262a833677
Author: josh-fell <48...@users.noreply.github.com>
AuthorDate: Mon Jul 26 07:16:19 2021 -0400

    Remove/refactor default_args pattern for Microsoft example DAGs (#16873)
---
 .../example_azure_container_instances.py             | 20 +++++++++-----------
 .../azure/example_dags/example_azure_cosmosdb.py     | 16 +++++++---------
 .../microsoft/winrm/example_dags/example_winrm.py    |  5 -----
 3 files changed, 16 insertions(+), 25 deletions(-)

diff --git a/airflow/providers/microsoft/azure/example_dags/example_azure_container_instances.py b/airflow/providers/microsoft/azure/example_dags/example_azure_container_instances.py
index 4848af0..75e626d 100644
--- a/airflow/providers/microsoft/azure/example_dags/example_azure_container_instances.py
+++ b/airflow/providers/microsoft/azure/example_dags/example_azure_container_instances.py
@@ -25,19 +25,17 @@ from airflow.providers.microsoft.azure.operators.azure_container_instances impor
     AzureContainerInstancesOperator,
 )
 
-default_args = {
-    'owner': 'airflow',
-    'depends_on_past': False,
-    'email': ['airflow@example.com'],
-    'email_on_failure': False,
-    'email_on_retry': False,
-    'retries': 1,
-    'retry_delay': timedelta(minutes=5),
-}
-
 with DAG(
     dag_id='aci_example',
-    default_args=default_args,
+    default_args={
+        'owner': 'airflow',
+        'depends_on_past': False,
+        'email': ['airflow@example.com'],
+        'email_on_failure': False,
+        'email_on_retry': False,
+        'retries': 1,
+        'retry_delay': timedelta(minutes=5),
+    },
     schedule_interval=timedelta(1),
     start_date=datetime(2018, 11, 1),
     tags=['example'],
diff --git a/airflow/providers/microsoft/azure/example_dags/example_azure_cosmosdb.py b/airflow/providers/microsoft/azure/example_dags/example_azure_cosmosdb.py
index a9bc6a7..8134d7b 100644
--- a/airflow/providers/microsoft/azure/example_dags/example_azure_cosmosdb.py
+++ b/airflow/providers/microsoft/azure/example_dags/example_azure_cosmosdb.py
@@ -31,17 +31,15 @@ from airflow.providers.microsoft.azure.operators.azure_cosmos import AzureCosmos
 from airflow.providers.microsoft.azure.sensors.azure_cosmos import AzureCosmosDocumentSensor
 from airflow.utils import dates
 
-default_args = {
-    'owner': 'airflow',
-    'depends_on_past': False,
-    'email': ['airflow@example.com'],
-    'email_on_failure': False,
-    'email_on_retry': False,
-}
-
 with DAG(
     dag_id='example_azure_cosmosdb_sensor',
-    default_args=default_args,
+    default_args={
+        'owner': 'airflow',
+        'depends_on_past': False,
+        'email': ['airflow@example.com'],
+        'email_on_failure': False,
+        'email_on_retry': False,
+    },
     start_date=dates.days_ago(2),
     doc_md=__doc__,
     tags=['example'],
diff --git a/airflow/providers/microsoft/winrm/example_dags/example_winrm.py b/airflow/providers/microsoft/winrm/example_dags/example_winrm.py
index 5912c46..7795837 100644
--- a/airflow/providers/microsoft/winrm/example_dags/example_winrm.py
+++ b/airflow/providers/microsoft/winrm/example_dags/example_winrm.py
@@ -36,13 +36,8 @@ from airflow.providers.microsoft.winrm.hooks.winrm import WinRMHook
 from airflow.providers.microsoft.winrm.operators.winrm import WinRMOperator
 from airflow.utils.dates import days_ago
 
-default_args = {
-    'owner': 'airflow',
-}
-
 with DAG(
     dag_id='POC_winrm_parallel',
-    default_args=default_args,
     schedule_interval='0 0 * * *',
     start_date=days_ago(2),
     dagrun_timeout=timedelta(minutes=60),