You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Others: Modify requirements.txt to include apache-airflow-providers-slack
What happened:
When importing the Slack Webhook operator, python throws a ModuleNotFoundError exception for the airflow.providers.http module.
$ python -c "import airflow.providers.slack.operators.slack_webhook"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/airflow/providers/slack/operators/slack_webhook.py", line 21, in <module>
from airflow.providers.http.operators.http import SimpleHttpOperator
ModuleNotFoundError: No module named 'airflow.providers.http'
What you expected to happen:
The module should import correctly, potentially with a DeprecationWarning
$ python -c "import airflow.providers.slack.operators.slack_webhook"
/usr/local/lib/python3.7/site-packages/airflow/providers/http/operators/http.py:26 DeprecationWarning: This decorator is deprecated.
In previous versions, all subclasses of BaseOperator must use apply_default decorator for the`default_args` feature to work properly.
In current version, it is optional. The decorator is applied automatically using the metaclass.
It appears that the module does not include apache-airflow-providers-http as a dependency.
The missing dependency is also missing from the provider.yaml file.
How to reproduce it:
Non-functional SlackWebhookOperator
Add apache-airflow-providers-slack to the requirements.txt
Start the astro local dev environment with astro dev start
Add example-slack-dag.py file to the dags folder with the following code
from airflow.providers.slack.operators.slack_webhook import SlackWebhookOperator
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from datetime import datetime
from airflow.providers.slack.operators.slack_webhook import SlackWebhookOperator
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
with DAG('slackwebhookoperator_import',
start_date=datetime(2019, 1, 1),
max_active_runs=3,
schedule_interval=None, # https://airflow.apache.org/docs/stable/scheduler.html#dag-runs
# catchup=False # enable if you don't want historical dag runs to run
) as dag:
t0 = DummyOperator(
task_id='start'
)
Observe DAG Import Error
Broken DAG: [/usr/local/airflow/dags/example-slack-dag.py] Traceback (most recent call last):
File "/usr/local/airflow/dags/example-slack-dag.py", line 1, in <module>
from airflow.providers.slack.operators.slack_webhook import SlackWebhookOperator
File "/usr/local/lib/python3.7/site-packages/airflow/providers/slack/operators/slack_webhook.py", line 21, in <module>
from airflow.providers.http.operators.http import SimpleHttpOperator
ModuleNotFoundError: No module named 'airflow.providers.http'
Functional SlackWebhookOperator
Add apache-airflow-providers-slack and apache-airflow-providers-http to the requirements.txt
Stop and start the local airflow environment with astro dev stop && astro dev start
Repeat step 3 from above, and observe no DAG Import Error.
Anything else we need to know: N/A
The text was updated successfully, but these errors were encountered:
Http provider used to be preinstalled in 2.0 and it had been disabled due.to licensing issues. It has been restored as preinstalled provider and will be back in 2.1.3.
Apache Airflow version: 2.1.1+astro.2
Kubernetes version: N/A
Environment: astro CLI local dev environment
Host
Container
Linux 971928acbe4c 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 GNU/Linux
astro dev start
apache-airflow-providers-slack
What happened:
When importing the Slack Webhook operator, python throws a ModuleNotFoundError exception for the airflow.providers.http module.
What you expected to happen:
The module should import correctly, potentially with a DeprecationWarning
It appears that the module does not include
apache-airflow-providers-http
as a dependency.The missing dependency is also missing from the provider.yaml file.
How to reproduce it:
Non-functional SlackWebhookOperator
apache-airflow-providers-slack
to the requirements.txtastro dev start
Functional SlackWebhookOperator
apache-airflow-providers-slack
andapache-airflow-providers-http
to the requirements.txtastro dev stop && astro dev start
Anything else we need to know: N/A
The text was updated successfully, but these errors were encountered: