mila-iqia / blocks-extras

A collection of extensions to the Blocks framework
MIT License
27 stars 40 forks source link

Fix unorderable types problem on Python 3. #32

Closed dwf closed 8 years ago

dwf commented 8 years ago

A recent pull request introduced an issue involving the comparison of unorderable types, which is noly an issue on Python 3. This fixes it by wrapping work items in a namedtuple-derived dummy class.

@johnarevalo

dwf commented 8 years ago

@rizar Please review and merge at will.

rizar commented 8 years ago

Can you provide a bit more explanation about this issue? I tried googling, but unsuccessfully.

Also, I don't like that the tests pass: https://travis-ci.org/mila-udem/blocks-extras/builds/90059416

johnarevalo commented 8 years ago

PushThread stores (int, ColumnDataSource) tuples in a PriorityQueue list. Python3 raises an exception because ColumnDataSource objects are unorderable. PriorityQueue Notes (2nd bullet), warned about it :(. I just successfully re-ran the same example with this fix in both Python2 and Python3 environments. could Travis have ignored the exception because it was raised from a non-main Thread?

rizar commented 8 years ago

Okay, thanks for the explanation. Regarding the Travis, I don't think we would see such a nice a log as in https://travis-ci.org/mila-udem/blocks-extras/jobs/90059420 if we had an exception, even if it was in a secondary thread. Thus, I am still puzzled.

dwf commented 8 years ago

This is going to be an annoying thing to test, and not that useful as the Bokeh server has been entirely rewritten (for the better, thankfully) and so this is going to probably go away anyway. I'd rather just merge the fix for the interim.

rizar commented 8 years ago

All right, all right, let's merge this.