Python 3 compatibility #116

merged 19 commits into from Aug 1, 2016


None yet

4 participants


No description provided.

wbolster commented Apr 2, 2016

all tests pass on python3.5 now

@wbolster wbolster referenced this pull request in eleme/thriftpy Apr 24, 2016

new release #197


We've been using this branch at our office for a while and it seems stable enough. Would love it if it went up on pypi.


good to hear this code works well for others.

a new upstream thriftpy release was a blocker for us, but that has been resolved in the mean time. only need to bump the minimum version in the deps.

i also want to update some docs a bit now that the bytes/text distinction is more explicit, since py3 no longer does "helpful" implicit conversions. also, the api docs generation is broken on readthedocs currently, not sure how to fix that yet.

currently travelling without access to a dev env, but will get back to (finally) resolving this py3 transition soonish.

— wouter

sent from my phone. please forgive my tpyos.

On May 16, 2016 6:21:59 PM GMT+02:00, Scott Cooper wrote:

We've been using this branch at our office for a while and it seems
stable enough. Would love it if it went up on pypi.

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#116 (comment)


Hey @wbolster , great job! We have a @Preetwinder our beloved Google Summer of Code student working on porting to support Python 3. In short, Frontera is a framework used to build large scale web crawlers with Python. In Frontera integration with HBase is crucial, and current lack of Python 3 support in happybase is a blocker for us.

If possible, could you please get Py3 happybase port done? This is very important for Preet to accomplish his GSoC goals. Let us know if you need any help: PR, reviews, testing, etc. At Scrapinghub we have lots of experience porting open source projects to Python 3.

Thank you!

cc @redapple.


the code is looking ok imho, but the docs aren't properly building. also, the docs need a few notes on bytes vs. strings. perhaps these issues should be ignored for now since it's not blocking any functionality.


@wbolster Nobody except you understand all the details that needs to be reflected in documentation, therefore I'm not sure if we can help there. What if you release a new version explaining that code is Py3 compatible and put a disclaimer in the docs saying that docs are outdated and missing type definitions? I would love to see it available on PyPI.

added some commits Mar 20, 2016
@wbolster @wbolster Add py35 environment to tox.ini 56c900f
@wbolster @wbolster Add 'six' dependency a5b3221
@wbolster @wbolster Use Python 3 compatible 'queue' import c67ceaa
@wbolster @wbolster Use range() instead of xrange() a8cf183
@wbolster @wbolster Accept both text and binary for table prefix args 75356bf
@wbolster @wbolster Use six.iteritems() f565282
@wbolster @wbolster Use list comprehension instead of calling map()
...which behaves differently on Python 3.
@wbolster @wbolster Add ensure_bytes() helper coerce unicode text into UTF-8 encoded byte strings.
@wbolster @wbolster Clean up helpers to transform rows and cell values 43f93ae
@wbolster @wbolster Column families are byte strings
...hence require splitting using a byte string.
@wbolster @wbolster Rewrite str_increment() as bytes_increment()
...and make it work on both Python 3 and 2.
@wbolster @wbolster Allow table names to be specified as binary or text
In HBase, the name is a byte string, but transparently encoding text
using UTF-8 allows for cleaner code on the Python side. This makes code


work on both Python 3 and 2.
@wbolster @wbolster Update tests for Python 3 compatibility 0903fe2
@wbolster Remove Python 3 support from todo list c470029
@wbolster Remove execfile() from doc config file
...since Python 3 does not have that function anymore.
@wbolster Update notes about strings/bytes in documentation ec5178d
@wbolster Use byte strings and print() function in example code eae66a3
@wbolster Mention Python 3 in trove classifiers fd0d175
@wbolster Fix outdated comment fc506cd
@wbolster wbolster changed the title from [wip] Python 3 compatibility to Python 3 compatibility Aug 1, 2016
@wbolster wbolster merged commit 04eae0b into master Aug 1, 2016

1 check passed

code-quality/landscape Code quality decreased by -0.59%
@wbolster wbolster deleted the python3 branch Aug 1, 2016
@wbolster wbolster referenced this pull request Aug 1, 2016

Python 3 support #40

3 of 3 tasks complete
wbolster commented Aug 1, 2016

merged, fixes #40

wbolster commented Aug 1, 2016

@scttcper @sibiryakov @Preetwinder @jeroenvlek @surfacepatterns

since you expressed interest in python 3 support for happybase, please test current master and report any issues! i think we're almost there ;)


@wbolster Thanks for doing this. I and @sibiryakov have been testing happybase on Python3 for the past few days. We have mainly used - connection.create/delete_table, table.batch and table.scan. These components have been working fine for us, and we didn't face any issue up-till now. If we encounter any issue in the future we will let you know. We hope you get to release a Python 3 supporting version soon. Thanks.


also table.rows()


ok, cool, thanks for testing this.

the tests also cover quite a large bit of the api, but since i don't use happybase myself anymore i don't have any real world applications to test against.

i'll make a release soon (when i find my pypi credentials 😕) i'll update #131 once i did so.


happybase 1.0.0 is available from pypi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment