python链接数据库

利用django搭建接口,在查询过程中遇到了如下问题
运行结果及报错内容
看了源码也不知道什么原因,并且重新运行还能跑通
这是什么原因啊
Traceback (most recent call last):
  File "E:\anaconda\envs\zz\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
    response = get_response(request)
  File "E:\anaconda\envs\zz\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "D:\小程序\mysite\blog\view_push.py", line 21, in push
    res = Push.get_com()
  File "D:\小程序\mysite\blog\push.py", line 74, in get_com
    return self.get_com()
  File "D:\小程序\mysite\blog\push.py", line 145, in get_com
    data = cur.fetchall()
  File "E:\anaconda\envs\zz\lib\site-packages\impala\hiveserver2.py", line 553, in fetchall
    elements = self._pop_from_buffer(self.buffersize)
  File "E:\anaconda\envs\zz\lib\site-packages\impala\hiveserver2.py", line 619, in _pop_from_buffer
    self._ensure_buffer_is_filled()
  File "E:\anaconda\envs\zz\lib\site-packages\impala\hiveserver2.py", line 605, in _ensure_buffer_is_filled
    self._buffer = self._last_operation.fetch(self.description,
  File "E:\anaconda\envs\zz\lib\site-packages\impala\hiveserver2.py", line 193, in description
    schema = self._last_operation.get_result_schema()
  File "E:\anaconda\envs\zz\lib\site-packages\impala\hiveserver2.py", line 1420, in get_result_schema
    for column in resp.schema.columns:
AttributeError: 'NoneType' object has no attribute 'columns'
[17/Nov/2022 18:03:15,671] - Broken pipe from ('192.168.0.62', 60372)
Internal Server Error: /push
Traceback (most recent call last):
  File "E:\anaconda\envs\zz\lib\site-packages\pandas\io\sql.py", line 2020, in execute
    cur.execute(*args, **kwargs)
  File "E:\anaconda\envs\zz\lib\site-packages\impala\hiveserver2.py", line 343, in execute
    self._wait_to_finish()  # make execute synchronous
  File "E:\anaconda\envs\zz\lib\site-packages\impala\hiveserver2.py", line 421, in _wait_to_finish
    operation_state = TOperationState._VALUES_TO_NAMES[resp.operationState]
KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\anaconda\envs\zz\lib\site-packages\pandas\io\sql.py", line 2024, in execute
    self.con.rollback()
  File "E:\anaconda\envs\zz\lib\site-packages\impala\hiveserver2.py", line 84, in rollback
    raise NotSupportedError
impala.error.NotSupportedError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "E:\anaconda\envs\zz\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
    response = get_response(request)
  File "E:\anaconda\envs\zz\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "D:\小程序\mysite\blog\view_push.py", line 21, in push
    res = Push.get_com()
  File "D:\小程序\mysite\blog\push.py", line 180, in get_com
    df1 = pd.read_sql(sql, conn)
  File "E:\anaconda\envs\zz\lib\site-packages\pandas\io\sql.py", line 566, in read_sql
    return pandas_sql.read_query(
  File "E:\anaconda\envs\zz\lib\site-packages\pandas\io\sql.py", line 2080, in read_query
    cursor = self.execute(*args)
  File "E:\anaconda\envs\zz\lib\site-packages\pandas\io\sql.py", line 2029, in execute
    raise ex from inner_exc
pandas.io.sql.DatabaseError: Execution failed on sql: with tmp as (SELECT company_key, info_type, info, ROW_NUMBER()OVER(PARTITION by company_key, info_type ORDER BY
info) as RANK
                            FROM ic.contact_info_all
                            WHERE company_key ='DANGDUONGPRODUCTI')
                            (SELECT company_key, info, info_type
                            from tmp
                            WHERE RANK=1 and (info_type='8' or info_type='9' or info_type='11')
                            UNION
                            SELECT company_key, info, info_type
                            from tmp
                            WHERE RANK<=5 and (info_type='1' or info_type='2' or info_type='10'));
None
unable to rollback


self.con.rollback()报错了
你执行select出错怎么还执行rollback呢