Skip to content

Systematic fails due to collections.Iterable deprecation #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rgeronimi opened this issue May 20, 2022 · 2 comments
Open

Systematic fails due to collections.Iterable deprecation #14

rgeronimi opened this issue May 20, 2022 · 2 comments

Comments

@rgeronimi
Copy link

rgeronimi commented May 20, 2022

The following call now fails systematically with Python 3.10:

ballpark.business(123)

with the error:

File /usr/local/Caskroom/miniconda/base/envs/myenv/lib/python3.10/site-packages/ballpark/utils.py:85, in unwrap.<locals>.unwrapped_function(values, *vargs, **kwargs)
     83 @functools.wraps(fn)
     84 def unwrapped_function(values, *vargs, **kwargs):
---> 85     scalar = not isinstance(values, collections.Iterable)
     87     if scalar:
     88         values = [values]

AttributeError: module 'collections' has no attribute 'Iterable'

This may impact several or all other ballpark functions (I didn't test the other ones).

This is due to Python 3.10 (or earlier, I don't know) deprecating collections.Iterable in favor of collections.abc.Iterable.

The fix is to update this accordingly.

@rgeronimi
Copy link
Author

rgeronimi commented May 20, 2022

This fork has exactly the right fixes, rsolving this issue as well as 2 other pending issues:

https://github.com/Mee6/python-ballpark

@db0
Copy link

db0 commented Sep 8, 2022

Looks like this project has been abandoned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants