Need Updates for python 3.10, using `collections.Iterable` as an example
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
Research direction
The traceback points to pyhive/common.py, especially escape_item at line 248, reached through hive.py execute and escape_args. Start by reading that path and reproduce the parameter-escaping failure under Python 3.10; it is done when the example no longer raises AttributeError for Iterable.
Written by the indexing model from the issue text.
Description
System Info:
Python 3.10.0 | packaged by conda-forge | (default, Nov 20 2021, 02:25:18) [GCC 9.4.0]
pyhive 0.6.4 | pyhd8ed1ab_0 | conda-forge
Logs:
~/anaconda3/envs/****/lib/python3.10/site-packages/pyhive/hive.py in execute(self, operation, parameters, **kwargs)
442 sql = operation
443 else:
--> 444 sql = operation % _escaper.escape_args(parameters)
445
446 self._reset_state()
~/anaconda3/envs/****/lib/python3.10/site-packages/pyhive/common.py in escape_args(self, parameters)
211 return {k: self.escape_item(v) for k, v in parameters.items()}
212 elif isinstance(parameters, (list, tuple)):
--> 213 return tuple(self.escape_item(x) for x in parameters)
214 else:
215 raise exc.ProgrammingError("Unsupported param format: {}".format(parameters))
~/anaconda3/envs/****/lib/python3.10/site-packages/pyhive/common.py in <genexpr>(.0)
211 return {k: self.escape_item(v) for k, v in parameters.items()}
212 elif isinstance(parameters, (list, tuple)):
--> 213 return tuple(self.escape_item(x) for x in parameters)
214 else:
215 raise exc.ProgrammingError("Unsupported param format: {}".format(parameters))
~/anaconda3/envs/****/lib/python3.10/site-packages/pyhive/common.py in escape_item(self, item)
246 elif isinstance(item, basestring):
247 return self.escape_string(item)
--> 248 elif isinstance(item, collections.Iterable):
249 return self.escape_sequence(item)
250 elif isinstance(item, datetime.datetime):
AttributeError: module 'collections' has no attribute 'Iterable'
This is because collections.Iterable is deprecated and we should use collections.abc.Iterable instead.
In fact, there has always been an DeprecationWarning in place:
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
Are there any plans for a code review for such updates?
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 545
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dropbox/PyHive
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Similar issues
-
agent-ready documentation needs-triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
instance instance add
Difficulty 1/5 Under an hour Newbie friendliness 72/100
searxng/searx-instances#939 · 1 comment ·
-
area-deployment area-integrations triage:bot-seen
Difficulty 2/5 Half a day Newbie friendliness 86/100