Accept unicode or byte string keys on streams
See original GitHub issueIt would be great if the dask.distributed scheduler could accept byte or unicode keys and not just strings of type str
as checked by validate_key
.
This issue came up while integrating the dask.distributed scheduler with julia client/workers in https://github.com/invenia/DaskDistributedDispatcher.jl, since julia msgpack will encode strings as either byte strings or unicode strings. Currently, this integration will not be able to support python 3.5 since it adds a bytes
class. Python 2 works since it treats byte strings as str
types.
Sample error when using python 3.5:
distributed.scheduler - ERROR - Unexpected key type <class 'bytes'> (value: b'Int64-4635863187378904022')
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Character and Byte Streams (The Java™ Tutorials ...
The java.io package provides classes that allow you to convert between Unicode character streams and byte streams of non-Unicode text.
Read more >Character Stream Vs Byte Stream in Java - GeeksforGeeks
In Java, characters are stored using Unicode conventions. Character stream automatically allows us to read/write data character by character.
Read more >Getting a unicode string from a raw TCP stream in C# - Stack ...
Try this: public static string ReadNT(BinaryReader stream) { List<byte> bytes = new List<byte>(); byte addByte = 0x00; do { addByte ...
Read more >String encodings - Shalvah's Blog
One byte = 8 bits, which means a byte can only hold 256 (2⁸) characters. For an encoding like Unicode to support more...
Read more >String And Unicode Handling — PycURL 7.43.0.1 ...
For convenience and compatibility with existing code, PycURL will accept Unicode strings that contain ASCII code points only [1], and transparently encode ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alternatively, you might submit a PR similar to #1234 that supports unicode keys in Python 2. If it doesn’t impact performance then I would have no issue merging such a PR. I personally though am somewhat slammed.
I tried in https://github.com/dask/distributed/pull/1328 but a bunch of tests started freezing