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 2019/01/12 19:54:45 UTC
[GitHub] kaxil closed pull request #4498: [AIRFLOW-3687] Add missing
@apply_defaults decorators
kaxil closed pull request #4498: [AIRFLOW-3687] Add missing @apply_defaults decorators
URL: https://github.com/apache/airflow/pull/4498
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/airflow/contrib/operators/databricks_operator.py b/airflow/contrib/operators/databricks_operator.py
index 3ebc729f78..c3c5d6e65b 100644
--- a/airflow/contrib/operators/databricks_operator.py
+++ b/airflow/contrib/operators/databricks_operator.py
@@ -24,6 +24,7 @@
from airflow.exceptions import AirflowException
from airflow.contrib.hooks.databricks_hook import DatabricksHook
from airflow.models import BaseOperator
+from airflow.utils.decorators import apply_defaults
XCOM_RUN_ID_KEY = 'run_id'
@@ -218,6 +219,7 @@ class DatabricksSubmitRunOperator(BaseOperator):
ui_color = '#1CB1C2'
ui_fgcolor = '#fff'
+ @apply_defaults
def __init__(
self,
json=None,
@@ -419,6 +421,7 @@ class DatabricksRunNowOperator(BaseOperator):
ui_color = '#1CB1C2'
ui_fgcolor = '#fff'
+ @apply_defaults
def __init__(
self,
job_id,
diff --git a/airflow/contrib/operators/druid_operator.py b/airflow/contrib/operators/druid_operator.py
index 426393deeb..1436d99f28 100644
--- a/airflow/contrib/operators/druid_operator.py
+++ b/airflow/contrib/operators/druid_operator.py
@@ -21,6 +21,7 @@
from airflow.hooks.druid_hook import DruidHook
from airflow.models import BaseOperator
+from airflow.utils.decorators import apply_defaults
class DruidOperator(BaseOperator):
@@ -36,6 +37,7 @@ class DruidOperator(BaseOperator):
template_fields = ('index_spec_str',)
template_ext = ('.json',)
+ @apply_defaults
def __init__(self, json_index_file,
druid_ingest_conn_id='druid_ingest_default',
max_ingestion_time=None,
diff --git a/airflow/contrib/operators/mongo_to_s3.py b/airflow/contrib/operators/mongo_to_s3.py
index e9747cac7f..a3fe63f387 100644
--- a/airflow/contrib/operators/mongo_to_s3.py
+++ b/airflow/contrib/operators/mongo_to_s3.py
@@ -21,6 +21,7 @@
from airflow.contrib.hooks.mongo_hook import MongoHook
from airflow.hooks.S3_hook import S3Hook
from airflow.models import BaseOperator
+from airflow.utils.decorators import apply_defaults
from bson import json_util
@@ -39,6 +40,7 @@ class MongoToS3Operator(BaseOperator):
template_fields = ['s3_key', 'mongo_query']
# pylint: disable=too-many-instance-attributes
+ @apply_defaults
def __init__(self,
mongo_conn_id,
s3_conn_id,
diff --git a/airflow/operators/python_operator.py b/airflow/operators/python_operator.py
index a92cb86642..c03a9a106e 100644
--- a/airflow/operators/python_operator.py
+++ b/airflow/operators/python_operator.py
@@ -226,6 +226,7 @@ class PythonVirtualenvOperator(PythonOperator):
processing templated fields, for examples ``['.sql', '.hql']``
:type templates_exts: list(str)
"""
+ @apply_defaults
def __init__(self, python_callable,
requirements=None,
python_version=None, use_dill=False,
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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