Kevin Geiszler created HBASE-29457:
--------------------------------------
Summary: thrift1/DemoClient.py is not running
Key: HBASE-29457
URL: https://issues.apache.org/jira/browse/HBASE-29457
Project: HBase
Issue Type: Improvement
Reporter: Kevin Geiszler
HBASE-29454 converts the following scripts from Python 2 to Python 3 and fixes
some import errors:
{code:java}
hbase-examples/src/main/python/thrift1/DemoClient.py
hbase-examples/src/main/python/thrift1/demo_hbase_thrift_over_http_tls.py
hbase-examples/src/main/python/thrift2/DemoClient.py
{code}
After these changes, the thrift1/DemoClient.py gets the following error when
trying to run it:
{code:java}
scanning tables...
found: b'kg_table'
found: b'kg_table2'
found: b'kg_table3'
found: b't1'
found: b'test'
creating table: demo_table
Traceback (most recent call last):
File
"/Users/kgeiszler/projects/hbase/hbase-examples/src/main/python/thrift1/DemoClient.py",
line 212, in <module>
demo_client(host, port, is_framed_transport)
File
"/Users/kgeiszler/projects/hbase/hbase-examples/src/main/python/thrift1/DemoClient.py",
line 92, in demo_client
client.createTable(t, columns)
File
"/Users/kgeiszler/projects/hbase/hbase-examples/src/main/python/thrift1/gen_py/hbase/Hbase.py",
line 988, in createTable
self.send_createTable(tableName, columnFamilies)
File
"/Users/kgeiszler/projects/hbase/hbase-examples/src/main/python/thrift1/gen_py/hbase/Hbase.py",
line 996, in send_createTable
args.write(self._oprot)
File
"/Users/kgeiszler/projects/hbase/hbase-examples/src/main/python/thrift1/gen_py/hbase/Hbase.py",
line 4973, in write
oprot.writeBinary(self.tableName)
File
"/Users/kgeiszler/projects/hbase/py-env/lib/python3.11/site-packages/thrift/protocol/TBinaryProtocol.py",
line 132, in writeBinary
self.trans.write(str)
File
"/Users/kgeiszler/projects/hbase/py-env/lib/python3.11/site-packages/thrift/transport/TTransport.py",
line 174, in write
raise e
File
"/Users/kgeiszler/projects/hbase/py-env/lib/python3.11/site-packages/thrift/transport/TTransport.py",
line 170, in write
self.__wbuf.write(buf)
TypeError: a bytes-like object is required, not 'str' {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)