WilliamTun commented on issue #11920:
URL: https://github.com/apache/airflow/issues/11920#issuecomment-735254331


   Hey @kaxil 
   
   I have successfully set up breeze. 
   
   I have created this folder:
   airflow/providers/sqlite/example_dags 
   and using other examples as a template, I have created two files in this 
folder: 
   1) __init__.py 
   2) example_sqlite.py 
   
   I noticed other paralogous files for file 2 in other folders, eg 
providers/mysql/example_dags/example_mysql.py 
   has this import: 
   from airflow.operators.mysql_operator import MySqlOperator
   
   HOWEVER, 
   `airflow.operators.mysql_operator is now deprecated. `
   simialrly,
   `airflow.operators.sqlite_operator is also deprecated. `
   
   Thus, I have made the appropriate changes to call this line instead: 
   `from airflow.providers.sqlite.operators import SqliteOperator`
   UNFORTUNATELY, this line is not working. 
   My IDE says: "cannot find reference to SqliteOperator" in __init__.py
   
   FUTHERMORE, when I run pre-commit run. 
   
   I get: 
   
   ```
   
pylint........................................................................................................................Failed
   - hook id: pylint
   - exit code: 2
   
   ************* Module airflow.providers.sqlite.example_dags.example_sqlite
   airflow/providers/sqlite/example_dags/example_sqlite.py:29:0: E0611: No name 
'SqliteOperator' in module 'airflow.providers.sqlite.operators' 
(no-name-in-module)
   ```
   
   I am confused because I can see in the repo there is clearly an __init__.py 
and sqlite.py file in airflow/providers/sqlite/operators 
   and when we look in sqlite.py, there is clearly a class:
   class SqliteOperator(BaseOperator) 
   
   So why can I not import this class? And subsequently, why is pylint failing 
when I run pre-commit tests? 
   
   


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


Reply via email to