You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/01/11 17:00:52 UTC

[GitHub] [airflow] cheemz opened a new issue #13617: Error when importing MsSQLOperator on Airflow 2.0.0

cheemz opened a new issue #13617:
URL: https://github.com/apache/airflow/issues/13617


   While importing MsSqlOperator on airflow 2.0.0 I am getting the below error:
   ModuleNotFoundError: No module named 'airflow.providers.odbc'
   
   Below is my docker file:
   
   ```
   FROM apache/airflow:2.0.0-python3.8
   RUN pip install --no-cache-dir --user apache-airflow-providers-microsoft-mssql
   RUN pip install --no-cache-dir --user apache-airflow-providers-oracle
   ```
   
   Below is my dag:
   
   ```
   import datetime as dt
   import time
   
   from airflow import DAG
   from airflow.providers.microsoft.mssql.operators.mssql import MsSqlOperator
   
   
   default_args = {
       'owner': 'airflow',
       'start_date': dt.datetime(2019, 11, 8, 23, 00, 00),
       'concurrency': 1,
       'retries': 0
   }
   
   dag = DAG(
       'mssql_test',
       default_args=default_args,
       description='connecting to server',
       schedule_interval='@once'
   )
   
   # testing
   sql_command = """SELECT * FROM TABLE_NAME_HERE;"""
   t1 = MsSqlOperator( task_id = 'selecting_table',
                       mssql_conn_id = 'CONNECTION_ID_HERE',
                       sql = sql_command,
                       dag = dag,
                       database = 'DATABASE_NAME_HERE',
                       autocommit = True)
   
   t1
   ```
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #13617: Error when importing MsSQLOperator on Airflow 2.0.0

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #13617:
URL: https://github.com/apache/airflow/issues/13617#issuecomment-758087735


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] cheemz closed issue #13617: Error when importing MsSQLOperator on Airflow 2.0.0

Posted by GitBox <gi...@apache.org>.
cheemz closed issue #13617:
URL: https://github.com/apache/airflow/issues/13617


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] mik-laj closed issue #13617: Error when importing MsSQLOperator on Airflow 2.0.0

Posted by GitBox <gi...@apache.org>.
mik-laj closed issue #13617:
URL: https://github.com/apache/airflow/issues/13617


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] cheemz removed a comment on issue #13617: Error when importing MsSQLOperator on Airflow 2.0.0

Posted by GitBox <gi...@apache.org>.
cheemz removed a comment on issue #13617:
URL: https://github.com/apache/airflow/issues/13617#issuecomment-758098941


   /sparkle


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on issue #13617: Error when importing MsSQLOperator on Airflow 2.0.0

Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #13617:
URL: https://github.com/apache/airflow/issues/13617#issuecomment-758237300


   You should also add odbc provider.
   ```
   pip install --no-cache-dir --user apache-airflow-providers-odbc
   ```
   https://github.com/apache/airflow/blob/d2754ef76958f8df4dcb6974e2cd2c1edb17935e/airflow/providers/microsoft/mssql/operators/mssql.py#L23
   It is also describe in package description.  https://pypi.org/project/apache-airflow-providers-microsoft-mssql/ (See: Cross provider package dependencies)
   
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] cheemz commented on issue #13617: Error when importing MsSQLOperator on Airflow 2.0.0

Posted by GitBox <gi...@apache.org>.
cheemz commented on issue #13617:
URL: https://github.com/apache/airflow/issues/13617#issuecomment-758098941


   /sparkle


----------------------------------------------------------------
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:
users@infra.apache.org