question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accept unicode or byte string keys on streams

See original GitHub issue

It 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:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mrocklincommented, Aug 11, 2017

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.

0reactions
iamed2commented, Aug 11, 2017

I tried in https://github.com/dask/distributed/pull/1328 but a bunch of tests started freezing

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found