Crunch-io / scrunch

Pythonic scripting library for cleaning data in Crunch
GNU Lesser General Public License v3.0
5 stars 7 forks source link

Scrunch compatibility with Python 3.11 #449

Closed shaikh-ma closed 7 months ago

shaikh-ma commented 9 months ago

Hello,

While attempting to use the scrunch library in one of my project running on Python 3.11 version, I found out that:

The only module that is preventing it, is the collections module in the Python standard library. The methods Mapping & Iterable had been moved to the collections.abc, in one of Python official versions.

On making slight changes to the imports, I was able to use the scrunch library (0.16.1.dev0+g13c3de1.d20231124) in my Python 3.11 compatible project, without any issues, working as expected.

Below are the changes, which I have tried out,

In the scrunch/datasets.py module.

if sys.version_info.major == 3:
    from collections.abc import Mapping
else:
    from collections import Mapping
  1. In the scrunch/order.py module.
    if sys.version_info.major == 3:
    from collections.abc import Iterable
    else:
    from collections import Iterable

Please could you have a look and make the scrunch library compatible with Python 3.11, since the above point seems to be only thing blocking it, probably.

alexbuchhammer commented 9 months ago

@jjdelc Any chance this can be looked at? We are trying to move our infrastructure to 3.11, this would allow us to have Crunch-related processes making a big step in that direction.

Thanks. Alex

jjdelc commented 9 months ago

Hi Alex, currently this isn't in our short term priorities. I can't make that decision. If you have a PR that supports 3.6 and 3.11 we could verify and merge it.

alexbuchhammer commented 8 months ago

Hey JJ - Aamir (@shaikh-ma ) will soon, around Feb., take care of it then and make a PR.

Aamir - let's chat again about it first!

FYI @jamesrkg

Cheers Alex

shaikh-ma commented 7 months ago

Thank you @jjdelc for merging the pull request #450, please could you also release a tag, when you get a chance, so that we can install the latest version.

Thanks & Regards, Aamir

jjdelc commented 7 months ago

Ah, thanks for this! I just pushed version 0.17.0 with this new PR in it

shaikh-ma commented 7 months ago

Thankyou! 🙂