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/07/07 08:55:19 UTC
[GitHub] [airflow] mik-laj opened a new pull request #9704: Fix warning about incompatible plugins
mik-laj opened a new pull request #9704:
URL: https://github.com/apache/airflow/pull/9704
One condition was bad and warns when the plugin is for admin and FAB flask.
---
Make sure to mark the boxes below before creating PR: [x]
- [X] Description above provides context of the change
- [X] Unit tests coverage for changes (not needed for documentation changes)
- [X] Target Github ISSUE in description if exists
- [X] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
- [X] Relevant documentation is updated including usage instructions.
- [X] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
---
In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
----------------------------------------------------------------
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
[GitHub] [airflow] mik-laj commented on a change in pull request #9704: Fix warning about incompatible plugins
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9704:
URL: https://github.com/apache/airflow/pull/9704#discussion_r450712391
##########
File path: tests/plugins/test_plugins_manager.py
##########
@@ -94,59 +95,53 @@ def test_entrypoint_plugin_errors_dont_raise_exceptions(self, mock_ep_plugins):
class TestPluginsManager(unittest.TestCase):
- class AirflowTestPropertyPlugin(AirflowPlugin):
Review comment:
I moved this class to the function to maintain one style of code. It's easier to find the right test when all the code is in one place.
----------------------------------------------------------------
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
[GitHub] [airflow] turbaszek commented on a change in pull request #9704: Fix warning about incompatible plugins
Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #9704:
URL: https://github.com/apache/airflow/pull/9704#discussion_r451345508
##########
File path: tests/plugins/test_plugins_manager.py
##########
@@ -94,59 +95,53 @@ def test_entrypoint_plugin_errors_dont_raise_exceptions(self, mock_ep_plugins):
class TestPluginsManager(unittest.TestCase):
- class AirflowTestPropertyPlugin(AirflowPlugin):
- name = "test_property_plugin"
+ def test_should_load_plugins_from_property(self):
+ class AirflowTestPropertyPlugin(AirflowPlugin):
+ name = "test_property_plugin"
+
+ @property
+ def operators(self):
+ from airflow.models.baseoperator import BaseOperator
+
+ class PluginPropertyOperator(BaseOperator):
+ pass
- @property
- def operators(self):
- from airflow.models.baseoperator import BaseOperator
+ return [PluginPropertyOperator]
- class PluginPropertyOperator(BaseOperator):
+ class TestNonPropertyHook(BaseHook):
pass
- return [PluginPropertyOperator]
+ hooks = [TestNonPropertyHook]
- class TestNonPropertyHook(BaseHook):
- pass
+ with mock_plugin_manager(plugins=[AirflowTestPropertyPlugin()]):
+ from airflow import plugins_manager
+ plugins_manager.integrate_dag_plugins()
- hooks = [TestNonPropertyHook]
+ self.assertIn('AirflowTestPropertyPlugin', str(plugins_manager.plugins))
+ self.assertIn('PluginPropertyOperator', str(plugins_manager.operators_modules[0].__dict__))
+ self.assertIn("TestNonPropertyHook", str(plugins_manager.hooks_modules[0].__dict__))
- @mock.patch('airflow.plugins_manager.plugins', [AirflowTestPropertyPlugin()])
- @mock.patch('airflow.plugins_manager.operators_modules', None)
- @mock.patch('airflow.plugins_manager.sensors_modules', None)
- @mock.patch('airflow.plugins_manager.hooks_modules', None)
- @mock.patch('airflow.plugins_manager.macros_modules', None)
- def test_should_load_plugins_from_property(self):
- from airflow import plugins_manager
- plugins_manager.integrate_dag_plugins()
- self.assertIn('TestPluginsManager.AirflowTestPropertyPlugin', str(plugins_manager.plugins))
- self.assertIn('PluginPropertyOperator', str(plugins_manager.operators_modules[0].__dict__))
- self.assertIn("TestNonPropertyHook", str(plugins_manager.hooks_modules[0].__dict__))
-
- @mock.patch('airflow.plugins_manager.plugins', [])
- @mock.patch('airflow.plugins_manager.admin_views', None)
- @mock.patch('airflow.plugins_manager.flask_blueprints', None)
- @mock.patch('airflow.plugins_manager.menu_links', None)
- @mock.patch('airflow.plugins_manager.flask_appbuilder_views', None)
- @mock.patch('airflow.plugins_manager.flask_appbuilder_menu_links', None)
+ @mock_plugin_manager(plugins=[])
Review comment:
Is it necessary if we use it in L136?
----------------------------------------------------------------
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
[GitHub] [airflow] turbaszek merged pull request #9704: Fix warning about incompatible plugins
Posted by GitBox <gi...@apache.org>.
turbaszek merged pull request #9704:
URL: https://github.com/apache/airflow/pull/9704
----------------------------------------------------------------
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