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/12/03 18:05:22 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #12788: Fix plugin macros not being exposed through airflow.macros

mik-laj commented on a change in pull request #12788:
URL: https://github.com/apache/airflow/pull/12788#discussion_r535461911



##########
File path: airflow/plugins_manager.py
##########
@@ -419,4 +420,9 @@ def integrate_macros_plugins() -> None:
 
         if macros_module:
             macros_modules.append(macros_module)
-            sys.modules[macros_module.__name__] = macros_module  # pylint: disable=no-member
+            # pylint: disable=no-member
+            sys.modules[macros_module.__name__] = macros_module
+            # Register the newly created module on airflow.macros such that it
+            # can be accessed when rendering templates.
+            setattr(macros, macros_module.__name__.split('.')[-1], macros_module)

Review comment:
       ```suggestion
               setattr(macros, plugin.name, macros_module)
   ```




----------------------------------------------------------------
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