marklit edited a comment on issue #14955:
URL: https://github.com/apache/airflow/issues/14955#issuecomment-805565049
I've managed to find an ugly way to import macros in Airflow 2.0.1 on Python
3.9. It's not the original `from airflow.macros import x` method from Airflow
1.x but it is working.
```python
def get_macro(name):
from airflow import plugins_manager
plugins_manager.integrate_macros_plugins()
for x in plugins_manager.plugins:
if x.name == name:
return x.macros[0]
raise Exception('Unable to find macro "%s"' % name)
_exec = get_macro('_exec')
_exec('pwd') # returns: '/home/ubuntu/airflow/dags\n'
```
--
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:
[email protected]