-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
types: support working with binary for Python 3 #211
types: support working with binary for Python 3 #211
Conversation
6efb9de
to
7da60f3
Compare
7da60f3
to
797d33d
Compare
797d33d
to
6aa89a6
Compare
Note: test this PR rebased on #213 to ensure different msgpack package version compatiility |
8772bc7
to
155b1d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no objections, just several suggestions.
LGTM.
c46c513
to
44fc747
Compare
4ec6748
to
88fa990
Compare
This patch add CHANGELOG.md file. Current CHANGELOG contents covers version 0.7.0, 0.7.1 changes and currently unreleased changes. For changes in versions before 0.7.0, see releases GitHub page [1]. 1. https://github.com/tarantool/tarantool-python/releases
2a4194e
to
4b8ae94
Compare
I glanced over the changes and I'm completely okay here. Please, finish the review with Sergey and proceed. |
4b8ae94
to
3d71614
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch!
LGTM
This is a breaking change. Before this patch, both bytes and str were encoded as mp_str. It was possible to work with utf and non-utf strings, but not with varbinary (mp_bin) [1]. This patch adds varbinary support for Python 3 by default. With Python 2 the behavior of the connector remains the same. Before this patch: * encoding="utf-8" (default) Python 3 -> Tarantool -> Python 3 str -> mp_str (string) -> str bytes -> mp_str (string) -> str mp_bin (varbinary) -> bytes * encoding=None Python 3 -> Tarantool -> Python 3 bytes -> mp_str (string) -> bytes str -> mp_str (string) -> bytes mp_bin (varbinary) -> bytes Using bytes as key was not supported by several methods (delete, update, select). After this patch: * encoding="utf-8" (default) Python 3 -> Tarantool -> Python 3 str -> mp_str (string) -> str bytes -> mp_bin (varbinary) -> bytes * encoding=None Python 3 -> Tarantool -> Python 3 bytes -> mp_str (string) -> bytes str -> mp_str (string) -> bytes mp_bin (varbinary) -> bytes Using bytes as key are now supported by all methods. Thus, encoding="utf-8" connection may be used to work with utf-8 strings and varbinary and encodine=None connection may be used to work with non-utf-8 strings. This patch does not add new restrictions (like "do not permit to use str in encoding=None mode because result may be confusing") to preserve current behavior (for example, using space name as str in schema get_space). 1. tarantool/tarantool#4201 Closes #105
3d71614
to
dd6ef5b
Compare
Since the release of tarantool/python 0.8.0 [1] several things has changed. * Issue #105 has been fixed [2]. * CI has been migrated to GitHub Actions [3]. * New connection pool (ConnectionPool) with master discovery was introduced [4]. * old connection pool (MeshConnection) with round-robin failover was deprecated [4]. These changes together with GitHub stars update are introduced with this patch. 1. https://github.com/tarantool/tarantool-python/releases/tag/0.8.0 2. tarantool/tarantool-python#211 3. tarantool/tarantool-python#213 4. tarantool/tarantool-python#207
Since the release of tarantool-python 0.8.0 [1] several things has changed. * Issue tarantool/tarantool-python#105 has been fixed [2]. * CI has been migrated to GitHub Actions [3]. * New connection pool (ConnectionPool) with master discovery was introduced [4]. * old connection pool (MeshConnection) with round-robin failover was deprecated [4]. These changes together with GitHub stars update are introduced with this patch. 1. https://github.com/tarantool/tarantool-python/releases/tag/0.8.0 2. tarantool/tarantool-python#211 3. tarantool/tarantool-python#213 4. tarantool/tarantool-python#207
Since the release of tarantool-python 0.8.0 [1] several things has changed. * Issue tarantool/tarantool-python#105 has been fixed [2]. * CI has been migrated to GitHub Actions [3]. * New connection pool (ConnectionPool) with master discovery was introduced [4]. * old connection pool (MeshConnection) with round-robin failover was deprecated [4]. These changes together with GitHub stars update are introduced with this patch. 1. https://github.com/tarantool/tarantool-python/releases/tag/0.8.0 2. tarantool/tarantool-python#211 3. tarantool/tarantool-python#213 4. tarantool/tarantool-python#207
Since the release of tarantool-python 0.8.0 [1] several things has changed. * Issue tarantool/tarantool-python#105 has been fixed [2]. * CI has been migrated to GitHub Actions [3]. * New connection pool (ConnectionPool) with master discovery was introduced [4]. * old connection pool (MeshConnection) with round-robin failover was deprecated [4]. These changes together with GitHub stars update are introduced with this patch. 1. https://github.com/tarantool/tarantool-python/releases/tag/0.8.0 2. tarantool/tarantool-python#211 3. tarantool/tarantool-python#213 4. tarantool/tarantool-python#207
* Update python connector comparison table Since the release of tarantool-python 0.8.0 [1] several things has changed. * Issue tarantool/tarantool-python#105 has been fixed [2]. * CI has been migrated to GitHub Actions [3]. * New connection pool (ConnectionPool) with master discovery was introduced [4]. * old connection pool (MeshConnection) with round-robin failover was deprecated [4]. These changes together with GitHub stars update are introduced with this patch. 1. https://github.com/tarantool/tarantool-python/releases/tag/0.8.0 2. tarantool/tarantool-python#211 3. tarantool/tarantool-python#213 4. tarantool/tarantool-python#207 * Update translation Co-authored-by: Patience Daur <[email protected]>
Merge after #213
This is a breaking change.
Before this patch, both bytes and str were encoded as mp_str. It was
possible to work with utf and non-utf strings, but not with
varbinary (mp_bin) [1]. This patch adds varbinary support for Python 3
by default. With Python 2 the behavior of the connector remains the same.
Before this patch:
encoding="utf-8" (default)
encoding=None
Using bytes as key was not supported by several methods (delete,
update, select).
After this patch:
encoding="utf-8" (default)
encoding=None
Using bytes as key are now supported by all methods.
Thus, encoding="utf-8" connection may be used to work with
utf-8 strings and varbinary and encodine=None connection
may be used to work with non-utf-8 strings.
This patch does not add new restrictions (like "do not permit to use
str in encoding=None mode because result may be confusing") to preserve
current behavior (for example, using space name as str in schema
get_space).
Closes #105