Skip to content

python3: make conversion to string deterministic #187

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

Closed
wants to merge 1 commit into from

Conversation

ligurio
Copy link
Member

@ligurio ligurio commented Jan 18, 2021

Response object is a unpacked msgpack structure, returned by Tarantool.
Nor msgpack-python [1] that used in tarantool-python nor msgpack [2]
itself cannot guarantee an order of keys in unpacked dictionaries.
Therefore we have different keys order with running tests under Python 2
and Python 3, for example box-py/call.test.py. To workaround a problem
proposed a conversion of dictionaries in a tuple to lists before
printing Response object.

  1. Add sort_keys parameter to Packer for stable dict packing. msgpack/msgpack-python#164
  2. Can ordering be enforced in msgpack. msgpack/msgpack#215

Response object is a unpacked msgpack structure, returned by Tarantool.
Nor msgpack-python [1] that used in tarantool-python nor msgpack [2]
itself cannot guarantee an order of keys in unpacked dictionaries.
Therefore we have different keys order with running tests under Python 2
and Python 3, for example box-py/call.test.py. To workaround a problem
proposed a conversion of dictionaries in a tuple to lists before
printing Response object.

1. msgpack/msgpack-python#164
2. msgpack/msgpack#215
@ligurio
Copy link
Member Author

ligurio commented Jan 19, 2021

Discussed and decided to workaround a problem in a test itself.
See tarantool/tarantool#5538

@ligurio ligurio closed this Jan 19, 2021
@DifferentialOrange DifferentialOrange deleted the ligurio/determenistic_response_print branch November 9, 2022 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant