Quando eu rodo o código do arquivo twitter_hooks.py, estou recebendo este erro:
No module named 'airflow.hooks.http_hooks'.
Variável de ambiente ativada e airflow_home exportada também.
O arquivo está na pasta: airflow/plugins/hooks/
No início do código, a IDE Pycharm não consegue importar o HttpHook dentro da biblioteca airflow. Esta importação parece estar "enxergando" a pasta ao invés de "enxergar" a biblioteca do airflow.
Mais detalhes do erro:
ERROR - No module named 'airflow.hooks.http_hooks'
Traceback (most recent call last):
File "/home/datapipeline/.env/lib/python3.8/site-packages/airflow/plugins_manager.py", line 218, in <module>
m = imp.load_source(namespace, filepath)
File "/usr/lib/python3.8/imp.py", line 171, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 702, in _load
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/datapipeline/airflow/plugins/hooks/twitter_hook.py", line 1, in <module>
from airflow.hooks.http_hooks import HttpHook
ModuleNotFoundError: No module named 'airflow.hooks.http_hooks'
[2021-08-06 09:53:08,276] {plugins_manager.py:226} ERROR - Failed to import plugin /home/datapipeline/airflow/plugins/hooks/twitter_hook.py