You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by jl...@apache.org on 2016/07/14 12:23:24 UTC
incubator-airflow git commit: [AIRFLOW-315] Fix blank lines code
style warnings
Repository: incubator-airflow
Updated Branches:
refs/heads/master 9f764275f -> 6c7c52c44
[AIRFLOW-315] Fix blank lines code style warnings
Closes #1653 from skudriashev/airflow-315
Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/6c7c52c4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/6c7c52c4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/6c7c52c4
Branch: refs/heads/master
Commit: 6c7c52c4475568560f394df0c51992937e678d0d
Parents: 9f76427
Author: Stanislav Kudriashev <st...@gmail.com>
Authored: Thu Jul 14 08:23:08 2016 -0400
Committer: jlowin <jl...@users.noreply.github.com>
Committed: Thu Jul 14 08:23:08 2016 -0400
----------------------------------------------------------------------
airflow/bin/cli.py | 1 +
airflow/configuration.py | 1 +
airflow/contrib/auth/backends/github_enterprise_auth.py | 1 +
airflow/contrib/auth/backends/ldap_auth.py | 1 +
airflow/contrib/auth/backends/password_auth.py | 1 +
airflow/contrib/hooks/datastore_hook.py | 1 +
airflow/contrib/hooks/qubole_hook.py | 1 +
airflow/contrib/hooks/vertica_hook.py | 1 +
airflow/contrib/operators/bigquery_operator.py | 1 +
airflow/contrib/operators/bigquery_to_bigquery.py | 1 +
airflow/contrib/operators/bigquery_to_gcs.py | 1 +
airflow/contrib/operators/fs_operator.py | 1 +
airflow/contrib/operators/gcs_download_operator.py | 1 +
airflow/contrib/operators/gcs_to_bq.py | 1 +
airflow/contrib/operators/mysql_to_gcs.py | 1 +
airflow/contrib/operators/vertica_to_hive.py | 1 +
.../example_dags/example_branch_python_dop_operator_3.py | 1 +
.../example_passing_params_via_test_command.py | 1 +
airflow/example_dags/example_xcom.py | 3 +++
airflow/exceptions.py | 11 ++++-------
airflow/hooks/__init__.py | 1 +
airflow/hooks/druid_hook.py | 1 +
airflow/hooks/mysql_hook.py | 1 +
.../versions/13eb55f81627_for_compatibility.py | 4 +++-
.../versions/211e584da130_add_ti_state_index.py | 1 +
.../338e90f54d61_more_logging_into_task_isntance.py | 1 +
.../migrations/versions/4446e08588_dagrun_start_end.py | 1 +
airflow/operators/__init__.py | 1 +
airflow/operators/hive_to_mysql.py | 1 +
airflow/plugins_manager.py | 3 +++
airflow/security/kerberos.py | 1 +
airflow/security/utils.py | 1 +
airflow/utils/helpers.py | 1 +
airflow/utils/logging.py | 2 +-
airflow/www/app.py | 2 ++
airflow/www/utils.py | 1 +
airflow/www/views.py | 1 +
37 files changed, 47 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/bin/cli.py
----------------------------------------------------------------------
diff --git a/airflow/bin/cli.py b/airflow/bin/cli.py
index e574044..455d8da 100755
--- a/airflow/bin/cli.py
+++ b/airflow/bin/cli.py
@@ -1026,5 +1026,6 @@ class CLIFactory(object):
sp.set_defaults(func=sub['func'])
return parser
+
def get_parser():
return CLIFactory.get_parser()
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/configuration.py
----------------------------------------------------------------------
diff --git a/airflow/configuration.py b/airflow/configuration.py
index c0e574b..ff9c361 100644
--- a/airflow/configuration.py
+++ b/airflow/configuration.py
@@ -37,6 +37,7 @@ warnings.filterwarnings(
warnings.filterwarnings(
action='default', category=PendingDeprecationWarning, module='airflow')
+
class AirflowConfigException(Exception):
pass
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/contrib/auth/backends/github_enterprise_auth.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/auth/backends/github_enterprise_auth.py b/airflow/contrib/auth/backends/github_enterprise_auth.py
index 9276ee6..61ae28d 100644
--- a/airflow/contrib/auth/backends/github_enterprise_auth.py
+++ b/airflow/contrib/auth/backends/github_enterprise_auth.py
@@ -31,6 +31,7 @@ from airflow.configuration import AirflowConfigException
_log = logging.getLogger(__name__)
+
def get_config_param(param):
return str(configuration.get('github_enterprise', param))
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/contrib/auth/backends/ldap_auth.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/auth/backends/ldap_auth.py b/airflow/contrib/auth/backends/ldap_auth.py
index f79529e..083d3ab 100644
--- a/airflow/contrib/auth/backends/ldap_auth.py
+++ b/airflow/contrib/auth/backends/ldap_auth.py
@@ -44,6 +44,7 @@ LOG = logging.getLogger(__name__)
class AuthenticationError(Exception):
pass
+
class LdapException(Exception):
pass
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/contrib/auth/backends/password_auth.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/auth/backends/password_auth.py b/airflow/contrib/auth/backends/password_auth.py
index 66b1df1..d7ac0c6 100644
--- a/airflow/contrib/auth/backends/password_auth.py
+++ b/airflow/contrib/auth/backends/password_auth.py
@@ -43,6 +43,7 @@ login_manager.login_message = None
LOG = logging.getLogger(__name__)
PY3 = version_info[0] == 3
+
class AuthenticationError(Exception):
pass
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/contrib/hooks/datastore_hook.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/hooks/datastore_hook.py b/airflow/contrib/hooks/datastore_hook.py
index 505ea3e..9b1dee3 100644
--- a/airflow/contrib/hooks/datastore_hook.py
+++ b/airflow/contrib/hooks/datastore_hook.py
@@ -16,6 +16,7 @@
from apiclient.discovery import build
from airflow.contrib.hooks.gcp_api_base_hook import GoogleCloudBaseHook
+
class DatastoreHook(GoogleCloudBaseHook):
"""
Interact with Google Cloud Datastore. This hook uses the Google Cloud Platform
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/contrib/hooks/qubole_hook.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/hooks/qubole_hook.py b/airflow/contrib/hooks/qubole_hook.py
index 120dcae..241d8dd 100755
--- a/airflow/contrib/hooks/qubole_hook.py
+++ b/airflow/contrib/hooks/qubole_hook.py
@@ -56,6 +56,7 @@ COMMAND_ARGS = {
'dbimportcmd': ['mode', 'hive_table', 'dbtap_id', 'db_table', 'where_clause', 'parallelism', 'extract_query', 'boundary_query', 'split_column', 'tags', 'name']
}
+
class QuboleHook(BaseHook):
def __init__(self, *args, **kwargs):
conn = self.get_connection(kwargs['qubole_conn_id'])
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/contrib/hooks/vertica_hook.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/hooks/vertica_hook.py b/airflow/contrib/hooks/vertica_hook.py
index 9d9ae1d..dc81ee1 100644
--- a/airflow/contrib/hooks/vertica_hook.py
+++ b/airflow/contrib/hooks/vertica_hook.py
@@ -17,6 +17,7 @@ from vertica_python import connect
from airflow.hooks.dbapi_hook import DbApiHook
+
class VerticaHook(DbApiHook):
'''
Interact with Vertica.
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/contrib/operators/bigquery_operator.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/bigquery_operator.py b/airflow/contrib/operators/bigquery_operator.py
index 9aacdd1..9751290 100644
--- a/airflow/contrib/operators/bigquery_operator.py
+++ b/airflow/contrib/operators/bigquery_operator.py
@@ -18,6 +18,7 @@ from airflow.contrib.hooks.bigquery_hook import BigQueryHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
+
class BigQueryOperator(BaseOperator):
"""
Executes BigQuery SQL queries in a specific BigQuery database
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/contrib/operators/bigquery_to_bigquery.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/bigquery_to_bigquery.py b/airflow/contrib/operators/bigquery_to_bigquery.py
index 52fea59..ed832ff 100644
--- a/airflow/contrib/operators/bigquery_to_bigquery.py
+++ b/airflow/contrib/operators/bigquery_to_bigquery.py
@@ -18,6 +18,7 @@ from airflow.contrib.hooks.bigquery_hook import BigQueryHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
+
class BigQueryToBigQueryOperator(BaseOperator):
"""
Copy a BigQuery table to another BigQuery table.
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/contrib/operators/bigquery_to_gcs.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/bigquery_to_gcs.py b/airflow/contrib/operators/bigquery_to_gcs.py
index 01fd7e6..bcfc2b7 100644
--- a/airflow/contrib/operators/bigquery_to_gcs.py
+++ b/airflow/contrib/operators/bigquery_to_gcs.py
@@ -18,6 +18,7 @@ from airflow.contrib.hooks.bigquery_hook import BigQueryHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
+
class BigQueryToCloudStorageOperator(BaseOperator):
"""
Transfers a BigQuery table to a Google Cloud Storage bucket.
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/contrib/operators/fs_operator.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/fs_operator.py b/airflow/contrib/operators/fs_operator.py
index 98db70e..f89564c 100644
--- a/airflow/contrib/operators/fs_operator.py
+++ b/airflow/contrib/operators/fs_operator.py
@@ -20,6 +20,7 @@ from airflow.operators.sensors import BaseSensorOperator
from airflow.contrib.hooks.fs_hook import FSHook
from airflow.utils.decorators import apply_defaults
+
class FileSensor(BaseSensorOperator):
"""
Waits for a file or folder to land in a filesystem
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/contrib/operators/gcs_download_operator.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/gcs_download_operator.py b/airflow/contrib/operators/gcs_download_operator.py
index aa2adf2..1d78cad 100644
--- a/airflow/contrib/operators/gcs_download_operator.py
+++ b/airflow/contrib/operators/gcs_download_operator.py
@@ -19,6 +19,7 @@ from airflow.contrib.hooks.gcs_hook import GoogleCloudStorageHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
+
class GoogleCloudStorageDownloadOperator(BaseOperator):
"""
Downloads a file from Google Cloud Storage.
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/contrib/operators/gcs_to_bq.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/gcs_to_bq.py b/airflow/contrib/operators/gcs_to_bq.py
index 07976e6..8a21de6 100644
--- a/airflow/contrib/operators/gcs_to_bq.py
+++ b/airflow/contrib/operators/gcs_to_bq.py
@@ -20,6 +20,7 @@ from airflow.contrib.hooks.bigquery_hook import BigQueryHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
+
class GoogleCloudStorageToBigQueryOperator(BaseOperator):
"""
Loads files from Google cloud storage into BigQuery.
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/contrib/operators/mysql_to_gcs.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/mysql_to_gcs.py b/airflow/contrib/operators/mysql_to_gcs.py
index a603e38..d35caf5 100644
--- a/airflow/contrib/operators/mysql_to_gcs.py
+++ b/airflow/contrib/operators/mysql_to_gcs.py
@@ -26,6 +26,7 @@ from decimal import Decimal
from MySQLdb.constants import FIELD_TYPE
from tempfile import NamedTemporaryFile
+
class MySqlToGoogleCloudStorageOperator(BaseOperator):
"""
Copy data from MySQL to Google cloud storage in JSON format.
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/contrib/operators/vertica_to_hive.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/vertica_to_hive.py b/airflow/contrib/operators/vertica_to_hive.py
index 57e4fa8..31ce110 100644
--- a/airflow/contrib/operators/vertica_to_hive.py
+++ b/airflow/contrib/operators/vertica_to_hive.py
@@ -23,6 +23,7 @@ from airflow.contrib.hooks.vertica_hook import VerticaHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
+
class VerticaToHiveTransfer(BaseOperator):
"""
Moves data from Vertia to Hive. The operator runs
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/example_dags/example_branch_python_dop_operator_3.py
----------------------------------------------------------------------
diff --git a/airflow/example_dags/example_branch_python_dop_operator_3.py b/airflow/example_dags/example_branch_python_dop_operator_3.py
index 19bb183..1dd190e 100644
--- a/airflow/example_dags/example_branch_python_dop_operator_3.py
+++ b/airflow/example_dags/example_branch_python_dop_operator_3.py
@@ -31,6 +31,7 @@ args = {
# alternating runs
dag = DAG(dag_id='example_branch_dop_operator_v3',schedule_interval='*/1 * * * *', default_args=args)
+
def should_run(ds, **kwargs):
print("------------- exec dttm = {} and minute = {}".format(kwargs['execution_date'], kwargs['execution_date'].minute))
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/example_dags/example_passing_params_via_test_command.py
----------------------------------------------------------------------
diff --git a/airflow/example_dags/example_passing_params_via_test_command.py b/airflow/example_dags/example_passing_params_via_test_command.py
index cd5a251..845f474 100644
--- a/airflow/example_dags/example_passing_params_via_test_command.py
+++ b/airflow/example_dags/example_passing_params_via_test_command.py
@@ -26,6 +26,7 @@ dag = DAG("example_passing_params_via_test_command",
dagrun_timeout=timedelta(minutes=4)
)
+
def my_py_command(ds, **kwargs):
# Print out the "foo" param passed in via
# `airflow test example_passing_params_via_test_command run_this <date>
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/example_dags/example_xcom.py
----------------------------------------------------------------------
diff --git a/airflow/example_dags/example_xcom.py b/airflow/example_dags/example_xcom.py
index 8dd2666..ed8825c 100644
--- a/airflow/example_dags/example_xcom.py
+++ b/airflow/example_dags/example_xcom.py
@@ -33,14 +33,17 @@ dag = airflow.DAG(
value_1 = [1, 2, 3]
value_2 = {'a': 'b'}
+
def push(**kwargs):
# pushes an XCom without a specific target
kwargs['ti'].xcom_push(key='value from pusher 1', value=value_1)
+
def push_by_returning(**kwargs):
# pushes an XCom without a specific target, just by returning it
return value_2
+
def puller(**kwargs):
ti = kwargs['ti']
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/exceptions.py
----------------------------------------------------------------------
diff --git a/airflow/exceptions.py b/airflow/exceptions.py
index 8edd1d8..a752694 100644
--- a/airflow/exceptions.py
+++ b/airflow/exceptions.py
@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-#
-# Any AirflowException raised is expected to cause the TaskInstance to be marked in an ERROR state
-#
+# Note: Any AirflowException raised is expected to cause the TaskInstance
+# to be marked in an ERROR state
+
+
class AirflowException(Exception):
pass
@@ -27,9 +28,5 @@ class AirflowTaskTimeout(AirflowException):
pass
-#
-# Any AirflowSkipException raised is expected to cause the TaskInstance to be marked in an SKIPPED state
-#
class AirflowSkipException(AirflowException):
pass
-
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/hooks/__init__.py
----------------------------------------------------------------------
diff --git a/airflow/hooks/__init__.py b/airflow/hooks/__init__.py
index 29d4379..4c1891d 100644
--- a/airflow/hooks/__init__.py
+++ b/airflow/hooks/__init__.py
@@ -61,6 +61,7 @@ if not _os.environ.get('AIRFLOW_USE_NEW_IMPORTS', False):
from airflow.utils.helpers import AirflowImporter
airflow_importer = AirflowImporter(sys.modules[__name__], _hooks)
+
def _integrate_plugins():
"""Integrate plugins to the context"""
import sys
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/hooks/druid_hook.py
----------------------------------------------------------------------
diff --git a/airflow/hooks/druid_hook.py b/airflow/hooks/druid_hook.py
index 4fe0020..3529375 100644
--- a/airflow/hooks/druid_hook.py
+++ b/airflow/hooks/druid_hook.py
@@ -26,6 +26,7 @@ from airflow.exceptions import AirflowException
LOAD_CHECK_INTERVAL = 5
DEFAULT_TARGET_PARTITION_SIZE = 5000000
+
class AirflowDruidLoadException(AirflowException):
pass
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/hooks/mysql_hook.py
----------------------------------------------------------------------
diff --git a/airflow/hooks/mysql_hook.py b/airflow/hooks/mysql_hook.py
index e81d796..9c8224c 100644
--- a/airflow/hooks/mysql_hook.py
+++ b/airflow/hooks/mysql_hook.py
@@ -17,6 +17,7 @@ import MySQLdb.cursors
from airflow.hooks.dbapi_hook import DbApiHook
+
class MySqlHook(DbApiHook):
'''
Interact with MySQL.
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/migrations/versions/13eb55f81627_for_compatibility.py
----------------------------------------------------------------------
diff --git a/airflow/migrations/versions/13eb55f81627_for_compatibility.py b/airflow/migrations/versions/13eb55f81627_for_compatibility.py
index 69971e7..f0ac907 100644
--- a/airflow/migrations/versions/13eb55f81627_for_compatibility.py
+++ b/airflow/migrations/versions/13eb55f81627_for_compatibility.py
@@ -26,8 +26,10 @@ down_revision = '1507a7289a2f'
branch_labels = None
depends_on = None
+
def upgrade():
pass
+
def downgrade():
- pass
\ No newline at end of file
+ pass
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/migrations/versions/211e584da130_add_ti_state_index.py
----------------------------------------------------------------------
diff --git a/airflow/migrations/versions/211e584da130_add_ti_state_index.py b/airflow/migrations/versions/211e584da130_add_ti_state_index.py
index 05aa321..ef6c395 100644
--- a/airflow/migrations/versions/211e584da130_add_ti_state_index.py
+++ b/airflow/migrations/versions/211e584da130_add_ti_state_index.py
@@ -33,5 +33,6 @@ import sqlalchemy as sa
def upgrade():
op.create_index('ti_state', 'task_instance', ['state'], unique=False)
+
def downgrade():
op.drop_index('ti_state', table_name='task_instance')
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/migrations/versions/338e90f54d61_more_logging_into_task_isntance.py
----------------------------------------------------------------------
diff --git a/airflow/migrations/versions/338e90f54d61_more_logging_into_task_isntance.py b/airflow/migrations/versions/338e90f54d61_more_logging_into_task_isntance.py
index 42b152f..51eef0c 100644
--- a/airflow/migrations/versions/338e90f54d61_more_logging_into_task_isntance.py
+++ b/airflow/migrations/versions/338e90f54d61_more_logging_into_task_isntance.py
@@ -30,6 +30,7 @@ from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
+
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column('task_instance', sa.Column('operator', sa.String(length=1000), nullable=True))
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/migrations/versions/4446e08588_dagrun_start_end.py
----------------------------------------------------------------------
diff --git a/airflow/migrations/versions/4446e08588_dagrun_start_end.py b/airflow/migrations/versions/4446e08588_dagrun_start_end.py
index d6f86d5..0ec1435 100644
--- a/airflow/migrations/versions/4446e08588_dagrun_start_end.py
+++ b/airflow/migrations/versions/4446e08588_dagrun_start_end.py
@@ -29,6 +29,7 @@ depends_on = None
from alembic import op
import sqlalchemy as sa
+
def upgrade():
op.add_column('dag_run', sa.Column('end_date', sa.DateTime(), nullable=True))
op.add_column('dag_run', sa.Column('start_date', sa.DateTime(), nullable=True))
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/operators/__init__.py
----------------------------------------------------------------------
diff --git a/airflow/operators/__init__.py b/airflow/operators/__init__.py
index e392b15..71acfcd 100644
--- a/airflow/operators/__init__.py
+++ b/airflow/operators/__init__.py
@@ -97,6 +97,7 @@ if not _os.environ.get('AIRFLOW_USE_NEW_IMPORTS', False):
from airflow.utils.helpers import AirflowImporter
airflow_importer = AirflowImporter(sys.modules[__name__], _operators)
+
def _integrate_plugins():
"""Integrate plugins to the context"""
import sys
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/operators/hive_to_mysql.py
----------------------------------------------------------------------
diff --git a/airflow/operators/hive_to_mysql.py b/airflow/operators/hive_to_mysql.py
index 36c91d4..4a64749 100644
--- a/airflow/operators/hive_to_mysql.py
+++ b/airflow/operators/hive_to_mysql.py
@@ -21,6 +21,7 @@ from airflow.utils.decorators import apply_defaults
from tempfile import NamedTemporaryFile
+
class HiveToMySqlTransfer(BaseOperator):
"""
Moves data from Hive to MySQL, note that for now the data is loaded
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/plugins_manager.py
----------------------------------------------------------------------
diff --git a/airflow/plugins_manager.py b/airflow/plugins_manager.py
index b6108f4..940aa87 100644
--- a/airflow/plugins_manager.py
+++ b/airflow/plugins_manager.py
@@ -29,9 +29,11 @@ merge = chain.from_iterable
from airflow import configuration
+
class AirflowPluginException(Exception):
pass
+
class AirflowPlugin(object):
name = None
operators = []
@@ -89,6 +91,7 @@ for root, dirs, files in os.walk(plugins_folder, followlinks=True):
logging.exception(e)
logging.error('Failed to import plugin ' + filepath)
+
def make_module(name, objects):
name = name.lower()
module = imp.new_module(name)
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/security/kerberos.py
----------------------------------------------------------------------
diff --git a/airflow/security/kerberos.py b/airflow/security/kerberos.py
index 2c248ef..ce336c4 100644
--- a/airflow/security/kerberos.py
+++ b/airflow/security/kerberos.py
@@ -101,6 +101,7 @@ def detect_conf_var():
finally:
f.close()
+
def run():
if configuration.get('kerberos','keytab') is None:
LOG.debug("Keytab renewer not starting, no keytab configured")
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/security/utils.py
----------------------------------------------------------------------
diff --git a/airflow/security/utils.py b/airflow/security/utils.py
index a634b2d..b2de3e3 100644
--- a/airflow/security/utils.py
+++ b/airflow/security/utils.py
@@ -71,6 +71,7 @@ def get_fqdn(hostname_or_ip=None):
return fqdn
+
def principal_from_username(username):
realm = conf.get("security", "default_realm")
if '@' not in username and realm:
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/utils/helpers.py
----------------------------------------------------------------------
diff --git a/airflow/utils/helpers.py b/airflow/utils/helpers.py
index 5fc8fc1..bddf0cb 100644
--- a/airflow/utils/helpers.py
+++ b/airflow/utils/helpers.py
@@ -74,6 +74,7 @@ def ask_yesno(question):
else:
print("Please respond by yes or no.")
+
def is_in(obj, l):
"""
Checks whether an object is one of the item in the list.
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/utils/logging.py
----------------------------------------------------------------------
diff --git a/airflow/utils/logging.py b/airflow/utils/logging.py
index 79c6cbf..4a18476 100644
--- a/airflow/utils/logging.py
+++ b/airflow/utils/logging.py
@@ -24,6 +24,7 @@ import logging
from airflow import configuration
from airflow.exceptions import AirflowException
+
class LoggingMixin(object):
"""
Convenience super-class to have a logger configured with the class name
@@ -80,7 +81,6 @@ class S3Log(object):
logging.error(err)
return err if return_error else ''
-
def write(self, log, remote_log_location, append=False):
"""
Writes the log to the remote_log_location. Fails silently if no hook
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/www/app.py
----------------------------------------------------------------------
diff --git a/airflow/www/app.py b/airflow/www/app.py
index a947f37..3953511 100644
--- a/airflow/www/app.py
+++ b/airflow/www/app.py
@@ -127,6 +127,8 @@ def create_app(config=None):
return app
app = None
+
+
def cached_app(config=None):
global app
if not app:
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/www/utils.py
----------------------------------------------------------------------
diff --git a/airflow/www/utils.py b/airflow/www/utils.py
index 7288a10..1a1229b 100644
--- a/airflow/www/utils.py
+++ b/airflow/www/utils.py
@@ -185,6 +185,7 @@ def json_response(obj):
status=200,
mimetype="application/json")
+
def gzipped(f):
'''
Decorator to make a view compressed
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6c7c52c4/airflow/www/views.py
----------------------------------------------------------------------
diff --git a/airflow/www/views.py b/airflow/www/views.py
index ae327f9..17f99d3 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -1795,6 +1795,7 @@ class SlaMissModelView(wwwutils.SuperUserMixin, ModelViewOnly):
'timestamp': {'disabled': True},
}
+
class ChartModelView(wwwutils.DataProfilingMixin, AirflowModelView):
verbose_name = "chart"
verbose_name_plural = "charts"