viralogic / py-enumerable

A Python module used for interacting with collections of objects using LINQ syntax
MIT License
188 stars 24 forks source link

Join does not behave the same as py-linq==1.2.1 #47

Closed ksusanto closed 4 years ago

ksusanto commented 4 years ago

from py_linq import Enumerable marks = Enumerable([(25,'a'), (49,'b'), (50,'c'), (80,'d'), (90,'e')]) passing = marks.where(lambda x: x[0] >= 50) # results in [(50, 'c'), (80, 'd'), (90, 'e')] omarks = Enumerable([(80,'eighty'),(49,'fortynine')]) omarks.join(passing, lambda o:o[0], lambda y:y[0], lambda result: result).to_list()

[((80, 'eighty'), (80, 'd'))] in py-linq==1.2.1

[((80, 'eighty'), (80, 'd')), ((49, 'fortynine'), (49, 'b'))] in py-linq==1.2.2

I think this is bug in 1.2.2, result supposed to be only [((80, 'eighty'), (80, 'd'))]

viralogic commented 4 years ago

@ksusanto Thanks for the feedback. Will investigate as soon as I can.

viralogic commented 4 years ago

@ksusanto I was able to replicate your issue. A fix has been deployed. Version 1.2.3

pip install --upgrade py-linq