types: support working with binary for Python 3#211
Merged
DifferentialOrange merged 2 commits intomasterfrom Apr 4, 2022
Merged
types: support working with binary for Python 3#211DifferentialOrange merged 2 commits intomasterfrom
DifferentialOrange merged 2 commits intomasterfrom
Conversation
6efb9de to
7da60f3
Compare
7da60f3 to
797d33d
Compare
797d33d to
6aa89a6
Compare
ligurio
suggested changes
Mar 22, 2022
Member
Author
|
Note: test this PR rebased on #213 to ensure different msgpack package version compatiility |
8772bc7 to
155b1d7
Compare
Totktonada
approved these changes
Mar 29, 2022
Contributor
Totktonada
left a comment
There was a problem hiding this comment.
I have no objections, just several suggestions.
LGTM.
c46c513 to
44fc747
Compare
Base automatically changed from
DifferentialOrange/gh-182-github-actions
to
master
March 31, 2022 08:37
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
Totktonada
reviewed
Apr 1, 2022
Contributor
|
I glanced over the changes and I'm completely okay here. Please, finish the review with Sergey and proceed. |
4b8ae94 to
3d71614
Compare
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
DifferentialOrange
added a commit
to tarantool/doc
that referenced
this pull request
May 11, 2022
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
DifferentialOrange
added a commit
to tarantool/doc
that referenced
this pull request
May 11, 2022
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
DifferentialOrange
added a commit
to tarantool/doc
that referenced
this pull request
May 11, 2022
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
patiencedaur
pushed a commit
to tarantool/doc
that referenced
this pull request
May 16, 2022
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
patiencedaur
added a commit
to tarantool/doc
that referenced
this pull request
May 16, 2022
* 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 <patiencedaur@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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