viralogic / py-enumerable

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

group_by bug #50

Closed GF-Huang closed 4 years ago

GF-Huang commented 4 years ago

image

image

viralogic commented 4 years ago

Hi @GF-Huang ,

Sorry that your experience with py-linq has been suboptimal. I am finding it hard to understand the context of why you are getting the error you are seeing based on the screenshots you submitted. Can you provide a little more information or a snippet of code that illustrates the bug you are encountering?

Unrelated to your error, it appears you are trying to group influxdb records by a field. Typically it is better to that within the database itself rather than pull records from the database first and then use a library like py-linq to do it. Maybe you could alter your code to group within influxdb instead?

Thanks for using py-linq.

Bruce

GF-Huang commented 4 years ago

The get_field() method will return either a_change or b_change (in this case is volume_change), I want to group them into two groups with key a_change and b_change, but the result use the first character of the string as key.

viralogic commented 4 years ago

@GF-Huang Thanks for extra information. I have replicated the issue. I will post a fix as soon as I can.

viralogic commented 4 years ago

Patch is out

pip install --upgrade py-linq