<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Python Error 'TSaslClientTransport' object has no attribute 'trans' when openning cursor to Impa in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Python-Error-TSaslClientTransport-object-has-no-attribute/m-p/69399#M65496</link>
    <description>&lt;P&gt;Was getting this issue in Airflow trying to use HiveServer2Hook:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ImportError: cannot import name TFrozenDict&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And figured it might be related to this pip warning:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;impyla 0.14.1 has requirement thrift&amp;lt;=0.9.3, but you'll have thrift 0.11.0 which is incompatible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I adjusted the thrift and impyla installs as indicated and now HiveServer2Hook works (and HiveOperator still works)--both of which are using kerberos beeline connections.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for posting the fix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jun 2018 12:32:21 GMT</pubDate>
    <dc:creator>cupdike</dc:creator>
    <dc:date>2018-06-27T12:32:21Z</dc:date>
    <item>
      <title>Python Error 'TSaslClientTransport' object has no attribute 'trans' when openning cursor to Impala</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Python-Error-TSaslClientTransport-object-has-no-attribute/m-p/58033#M65494</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;using Ubuntu 14.0.4 and 16.0.4 unable to work with Impala via Python .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Installed :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;pip install impyla&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;pip install thrift_sasl&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;pip install sasl&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thrift version install :&lt;/P&gt;&lt;P&gt;&lt;EM&gt;thrift (0.10.0)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;thrift-sasl (0.2.1)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;impyla (0.14.0)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Example Code&lt;/P&gt;&lt;P&gt;------------------------------&lt;/P&gt;&lt;P&gt;from impala.dbapi import connect&lt;BR /&gt;conn = connect(host="104.198.200.187", port="25003", user="user", password='pass', auth_mechanism='PLAIN')&lt;BR /&gt;&lt;BR /&gt;print "Connected Successfully"&lt;BR /&gt;&lt;BR /&gt;cur = conn.cursor()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;stack error :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "/home/alon/PycharmProjects/test/test.py", line 6, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cur = conn.cursor()&lt;BR /&gt;&amp;nbsp; File "/usr/local/lib/python2.7/dist-packages/impala/hiveserver2.py", line 125, in cursor&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; session = self.service.open_session(user, configuration)&lt;BR /&gt;&amp;nbsp; File "/usr/local/lib/python2.7/dist-packages/impala/hiveserver2.py", line 995, in open_session&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; resp = self._rpc('OpenSession', req)&lt;BR /&gt;&amp;nbsp; File "/usr/local/lib/python2.7/dist-packages/impala/hiveserver2.py", line 923, in _rpc&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; response = self._execute(func_name, request)&lt;BR /&gt;&amp;nbsp; File "/usr/local/lib/python2.7/dist-packages/impala/hiveserver2.py", line 940, in _execute&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return func(request)&lt;BR /&gt;&amp;nbsp; File "/usr/local/lib/python2.7/dist-packages/impala/_thrift_gen/TCLIService/TCLIService.py", line 175, in OpenSession&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.recv_OpenSession()&lt;BR /&gt;&amp;nbsp; File "/usr/local/lib/python2.7/dist-packages/impala/_thrift_gen/TCLIService/TCLIService.py", line 193, in recv_OpenSession&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result.read(self._iprot)&lt;BR /&gt;&amp;nbsp; File "/usr/local/lib/python2.7/dist-packages/impala/_thrift_gen/TCLIService/TCLIService.py", line 1109, in read&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))&lt;BR /&gt;AttributeError: 'TSaslClientTransport' object has no attribute 'trans'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dont know what is going wrong here .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 11:59:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Python-Error-TSaslClientTransport-object-has-no-attribute/m-p/58033#M65494</guid>
      <dc:creator>AlonEldi</dc:creator>
      <dc:date>2022-09-16T11:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Python Error 'TSaslClientTransport' object has no attribute 'trans' when openning cursor to Impa</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Python-Error-TSaslClientTransport-object-has-no-attribute/m-p/58034#M65495</link>
      <description>&lt;P&gt;Solved the problem by reinstalling thrift and impyla with the following versions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as root :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pip uninstall thrift&lt;/P&gt;&lt;P&gt;pip uninstall impyla&lt;/P&gt;&lt;P&gt;pip install thrift==0.9.3&lt;/P&gt;&lt;P&gt;pip install impyla==0.13.8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alon&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 11:40:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Python-Error-TSaslClientTransport-object-has-no-attribute/m-p/58034#M65495</guid>
      <dc:creator>AlonEldi</dc:creator>
      <dc:date>2017-07-26T11:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Python Error 'TSaslClientTransport' object has no attribute 'trans' when openning cursor to Impa</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Python-Error-TSaslClientTransport-object-has-no-attribute/m-p/69399#M65496</link>
      <description>&lt;P&gt;Was getting this issue in Airflow trying to use HiveServer2Hook:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ImportError: cannot import name TFrozenDict&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And figured it might be related to this pip warning:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;impyla 0.14.1 has requirement thrift&amp;lt;=0.9.3, but you'll have thrift 0.11.0 which is incompatible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I adjusted the thrift and impyla installs as indicated and now HiveServer2Hook works (and HiveOperator still works)--both of which are using kerberos beeline connections.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for posting the fix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 12:32:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Python-Error-TSaslClientTransport-object-has-no-attribute/m-p/69399#M65496</guid>
      <dc:creator>cupdike</dc:creator>
      <dc:date>2018-06-27T12:32:21Z</dc:date>
    </item>
  </channel>
</rss>

