[
https://issues.apache.org/jira/browse/AIRFLOW-1068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16671615#comment-16671615
]
jack commented on AIRFLOW-1068:
-------------------------------
Are you referring to this ?
https://github.com/pymssql/pymssql/commit/dd42d5e962cd42eeb8e6ce24a0a09135e92ef990
> Autocommit error with Airflow v1.7.1.3 and pymssql v2.1.3
> ---------------------------------------------------------
>
> Key: AIRFLOW-1068
> URL: https://issues.apache.org/jira/browse/AIRFLOW-1068
> Project: Apache Airflow
> Issue Type: Bug
> Components: db, hooks
> Affects Versions: 1.7.1.3
> Environment: OS: Centos 6
> pymssql: 2.1.3
> Reporter: Thomas Christie
> Priority: Major
>
> After upgrading pymssql started getting the following error when trying to
> use the MSSQL hook.
> [2017-04-04 13:02:27,260] {models.py:1286} ERROR - 'pymssql.Connection'
> object attribute 'autocommit' is read-only
> Traceback (most recent call last):
> File
> "/home/jobrunner/.virtualenvs/airflow/lib/python3.5/site-packages/airflow/models.py",
> line 1245, in run
> result = task_copy.execute(context=context)
> File
> "/home/jobrunner/.virtualenvs/airflow/lib/python3.5/site-packages/airflow/operators/mssql_operator.py",
> line 34, in execute
> hook.run(self.sql, parameters=self.parameters)
> File
> "/home/jobrunner/.virtualenvs/airflow/lib/python3.5/site-packages/airflow/hooks/dbapi_hook.py",
> line 124, in run
> self.set_autocommit(conn, autocommit)
> File
> "/home/jobrunner/.virtualenvs/airflow/lib/python3.5/site-packages/airflow/hooks/dbapi_hook.py",
> line 138, in set_autocommit
> conn.autocommit = autocommit
> AttributeError: 'pymssql.Connection' object attribute 'autocommit' is
> read-only
> I looked at the dbapi_hook.py file and this is the offending line:
> def set_autocommit(self, conn, autocommit):
> conn.autocommit = autocommit
> Changing the line to:
> conn.autocommit(autocommit)
> seems to work. From what I understand, autocommit was a getter/setter method
> in pymssql versions <2.0.0. Maybe they've reverted the behavior?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)