[jira] [Commented] (AIRFLOW-2847) Remove deprecated plugin import support

2018-09-21 Thread holdenk (JIRA)


[ 
https://issues.apache.org/jira/browse/AIRFLOW-2847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16623980#comment-16623980
 ] 

holdenk commented on AIRFLOW-2847:
--

Yup, sorry for the delay I've been traveling. Just marked the issue as resolved 
and set the fix version to 2.0.0. The PR is closed as well :)

> Remove deprecated plugin import support
> ---
>
> Key: AIRFLOW-2847
> URL: https://issues.apache.org/jira/browse/AIRFLOW-2847
> Project: Apache Airflow
>  Issue Type: Improvement
>Affects Versions: 2.0.0
>Reporter: holdenk
>Assignee: holdenk
>Priority: Major
> Fix For: 2.0.0
>
>
> As stated in the TODOs in macros,sensors, etc. we should remove the old 
> import mechanism for 2.0 since its been deprecated with 2.0 as the slated 
> removal time-frame.
>  
> Note: I made the issue "Major" but it _might_ be a blocker but since it's 
> listed as to be removed in 2.0, but I'm not familiar enough with whats 
> consider blockers on this project to do that.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRFLOW-2847) Remove deprecated plugin import support

2018-09-21 Thread Iuliia Volkova (JIRA)


[ 
https://issues.apache.org/jira/browse/AIRFLOW-2847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16623402#comment-16623402
 ] 

Iuliia Volkova commented on AIRFLOW-2847:
-

[~holdenk], hi! Is this task done? PR was merged. If it so, can you close it? 

> Remove deprecated plugin import support
> ---
>
> Key: AIRFLOW-2847
> URL: https://issues.apache.org/jira/browse/AIRFLOW-2847
> Project: Apache Airflow
>  Issue Type: Improvement
>Affects Versions: 2.0.0
>Reporter: holdenk
>Assignee: holdenk
>Priority: Major
>
> As stated in the TODOs in macros,sensors, etc. we should remove the old 
> import mechanism for 2.0 since its been deprecated with 2.0 as the slated 
> removal time-frame.
>  
> Note: I made the issue "Major" but it _might_ be a blocker but since it's 
> listed as to be removed in 2.0, but I'm not familiar enough with whats 
> consider blockers on this project to do that.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRFLOW-2847) Remove deprecated plugin import support

2018-09-05 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/AIRFLOW-2847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16605219#comment-16605219
 ] 

ASF GitHub Bot commented on AIRFLOW-2847:
-

feng-tao closed pull request #3692: [AIRFLOW-2847] Remove legacy imports 
support for plugins for 2.0 deprecation.
URL: https://github.com/apache/incubator-airflow/pull/3692
 
 
   

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/hooks/__init__.py b/airflow/hooks/__init__.py
index 38a7dcfebe..1553f3ab56 100644
--- a/airflow/hooks/__init__.py
+++ b/airflow/hooks/__init__.py
@@ -22,75 +22,12 @@
 import sys
 
 
-# 
-#
-# #TODO #FIXME Airflow 2.0
-#
-# Old import machinary below.
-#
-# This is deprecated but should be kept until Airflow 2.0
-# for compatibility.
-#
-# 
-
 # Imports the hooks dynamically while keeping the package API clean,
 # abstracting the underlying modules
 
-
-_hooks = {
-'base_hook': ['BaseHook'],
-'hive_hooks': [
-'HiveCliHook',
-'HiveMetastoreHook',
-'HiveServer2Hook',
-],
-'hdfs_hook': ['HDFSHook'],
-'webhdfs_hook': ['WebHDFSHook'],
-'pig_hook': ['PigCliHook'],
-'mysql_hook': ['MySqlHook'],
-'postgres_hook': ['PostgresHook'],
-'presto_hook': ['PrestoHook'],
-'samba_hook': ['SambaHook'],
-'sqlite_hook': ['SqliteHook'],
-'S3_hook': ['S3Hook'],
-'zendesk_hook': ['ZendeskHook'],
-'http_hook': ['HttpHook'],
-'druid_hook': [
-'DruidHook',
-'DruidDbApiHook',
-],
-'jdbc_hook': ['JdbcHook'],
-'dbapi_hook': ['DbApiHook'],
-'mssql_hook': ['MsSqlHook'],
-'oracle_hook': ['OracleHook'],
-'slack_hook': ['SlackHook'],
-}
-
-
-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"""
 from airflow.plugins_manager import hooks_modules
 for hooks_module in hooks_modules:
 sys.modules[hooks_module.__name__] = hooks_module
 globals()[hooks_module._name] = hooks_module
-
-##
-# TODO FIXME Remove in Airflow 2.0
-
-if not os.environ.get('AIRFLOW_USE_NEW_IMPORTS', False):
-from zope.deprecation import deprecated
-for _hook in hooks_module._objects:
-hook_name = _hook.__name__
-globals()[hook_name] = _hook
-deprecated(
-hook_name,
-"Importing plugin hook '{i}' directly from "
-"'airflow.hooks' has been deprecated. Please "
-"import from 'airflow.hooks.[plugin_module]' "
-"instead. Support for direct imports will be dropped "
-"entirely in Airflow 2.0.".format(i=hook_name))
diff --git a/airflow/macros/__init__.py b/airflow/macros/__init__.py
index 81782727eb..fdd64f88a6 100644
--- a/airflow/macros/__init__.py
+++ b/airflow/macros/__init__.py
@@ -74,20 +74,3 @@ def _integrate_plugins():
 for macros_module in macros_modules:
 sys.modules[macros_module.__name__] = macros_module
 globals()[macros_module._name] = macros_module
-
-##
-# TODO FIXME Remove in Airflow 2.0
-
-import os
-if not os.environ.get('AIRFLOW_USE_NEW_IMPORTS', False):
-from zope.deprecation import deprecated
-for _macro in macros_module._objects:
-macro_name = _macro.__name__
-globals()[macro_name] = _macro
-deprecated(
-macro_name,
-"Importing plugin macro '{i}' directly from "
-"'airflow.macros' has been deprecated. Please "
-"import from 'airflow.macros.[plugin_module]' "
-"instead. Support for direct imports will be dropped "
-"entirely in Airflow 2.0.".format(i=macro_name))
diff --git a/airflow/operators/__init__.py b/airflow/operators/__init__.py
index f732d8f8a8..51715bc8e7 100644
--- a/airflow/operators/__init__.py
+++ b/airflow/operators/__init__.py
@@ -90,19 +90,3 @@ def _integrate_plugins():
 for operators_module in operators_modules:
 sys.modules[operators_module.__name__] = operators_module
 globals()[operators_module._name] = operators_module
-
-

[jira] [Commented] (AIRFLOW-2847) Remove deprecated plugin import support

2018-08-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/AIRFLOW-2847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16568907#comment-16568907
 ] 

ASF GitHub Bot commented on AIRFLOW-2847:
-

holdenk opened a new pull request #3692: [AIRFLOW-2847][WIP] Remove legacy 
imports support for plugins
URL: https://github.com/apache/incubator-airflow/pull/3692
 
 
   [AIRFLOW-2847] Remove legacy imports support for plugins
   
   This is a WIP since the tests on master aren't passing locally on my machine 
(5 out of 8 for `./run_unit_tests.sh  ./tests/plugins_manager.py` pass), I'll 
drop the WIP if this passes CI.
   
   ### Jira
   
   - [ X ] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references 
them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
 - https://issues.apache.org/jira/browse/AIRFLOW-XXX
 - In case you are fixing a typo in the documentation you can prepend your 
commit with \[AIRFLOW-XXX\], code changes always need a Jira issue.
   
   ### Description
   
   - [ ] Here are some details about my PR, including screenshots of any UI 
changes:
   
   ### Tests
   
   - [ X ] My PR adds the following unit tests __OR__ does not need testing for 
this extremely good reason:
   Existing unit tests for plugins.
   
   ### Commits
   
   - [ X ] My commits all reference Jira issues in their subject lines, and I 
have squashed multiple commits if they address the same issue. In addition, my 
commits follow the guidelines from "[How to write a good git commit 
message](http://chris.beams.io/posts/git-commit/)":
 1. Subject is separated from body by a blank line
 1. Subject is limited to 50 characters (not including Jira issue reference)
 1. Subject does not end with a period
 1. Subject uses the imperative mood ("add", not "adding")
 1. Body wraps at 72 characters
 1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [ ] In case of new functionality, my PR adds documentation that describes 
how to use it.
 - When adding new operators/hooks/sensors, the autoclass documentation 
generation needs to be added.
   
   ### Code Quality
   
   - [ X ] Passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
   


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:
us...@infra.apache.org


> Remove deprecated plugin import support
> ---
>
> Key: AIRFLOW-2847
> URL: https://issues.apache.org/jira/browse/AIRFLOW-2847
> Project: Apache Airflow
>  Issue Type: Improvement
>Affects Versions: Airflow 2.0
>Reporter: holdenk
>Assignee: holdenk
>Priority: Major
>
> As stated in the TODOs in macros,sensors, etc. we should remove the old 
> import mechanism for 2.0 since its been deprecated with 2.0 as the slated 
> removal time-frame.
>  
> Note: I made the issue "Major" but it _might_ be a blocker but since it's 
> listed as to be removed in 2.0, but I'm not familiar enough with whats 
> consider blockers on this project to do that.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)