Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Need Updates for python 3.10, using `collections.Iterable` as an example

Đang mở
#421 5 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
databases

Hướng nghiên cứu

Traceback trỏ đến pyhive/common.py, đặc biệt là escape_item ở dòng 248, được gọi qua hive.py execute và escape_args. Hãy bắt đầu bằng cách đọc đường đi đó và tái hiện lỗi escape tham số trên Python 3.10; công việc hoàn tất khi ví dụ không còn phát sinh AttributeError cho Iterable.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?

Ngôn ngữ chính
Python
Star
1.7k
Fork
545
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dropbox/PyHive

Tất cả issue của dropbox/PyHive

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.