airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerard Toonstra (JIRA)" <>
Subject [jira] [Commented] (AIRFLOW-1154) Always getting Please import from '<module 'airflow....' from
Date Thu, 27 Apr 2017 08:09:04 GMT


Gerard Toonstra commented on AIRFLOW-1154:

I attempted to replicate this behavior, but wasn't able to. Note that any DAG importing the
python operator this way may give you this warning. 

I'm noticing you have a .local , so you did a pip install --user at some point. You should
make sure whether you have a system-wide install as well perhaps. The example dags before
the change would also import directly, but that changed. If you upgraded, you may be picking
up example dags perhaps from the airflow distribution.

What I did was to install apache airflow 1.8.0 from "puckel" and load all example dags in
there. There were no deprecation warnings. I removed the "python_operator" from the example
python DAG and the deprecation warning started appearing. I moved this back and the warning
went away.

You can use the  puckel docker airflow to validate
that behavior yourself too. If you do see different results, please let us know and we have
another look. 

Alternative: do a grep in your site-packages/airflow directory on:

grep -r "from airflow.operators import" *

> Always getting Please import from '<module 'airflow....' from 
> --------------------------------------------------------------
>                 Key: AIRFLOW-1154
>                 URL:
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: Arthur Zubarev
>            Priority: Minor
> Un Ubuntu 16 LTS 
> No matter how I import the module I am getting messages like
> /home/.../.local/lib/python2.7/site-packages/airflow/utils/ DeprecationWarning:
Importing PythonOperator directly from <module 'airflow.operators' from '/home/.../.local/lib/python2.7/site-packages/airflow/operators/__init__.pyc'>
has been deprecated. Please import from '<module 'airflow.operators' from '/home/.../.local/lib/python2.7/site-packages/airflow/operators/__init__.pyc'>.[operator_module]'
instead. Support for direct imports will be dropped entirely in Airflow 2.0.
>   DeprecationWarning).
> The above is happening even when imported as 
> 'from airflow.operators.python_operator import PythonOperator'

This message was sent by Atlassian JIRA

View raw message