ghapi.page.paged does not respect rate limits
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu với entry point ghapi.page.paged và luồng request được thể hiện trong ghapi/core.py, sau đó kiểm tra fastcore/net.py, nơi các lỗi HTTP được phát sinh. Tái hiện ví dụ search.code và theo dõi các header rate-limit cũng như hành vi phân trang. Công việc được xem là hoàn tất khi ví dụ có thể phân trang mà không liên tục nhận các phản hồi HTTP 403, đồng thời tuân thủ các rate limit được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Calling it almost always results in HTTP403ForbiddenError: HTTP Error 403: Forbidden
for result in ghapi.page.paged(gh_api.search.code, q=f"filename:component.yaml repo:Ark-kun/pipeline_components"):
print(len(result["items"]))
opt/conda/lib/python3.7/site-packages/ghapi/core.py in __call__(self, path, verb, headers, route, query, data)
107 for k,v in route.items(): route[k] = quote(str(route[k]))
108 res,self.recv_hdrs = urlsend(path, verb, headers=headers or None, debug=self.debug, return_headers=True,
--> 109 route=route or None, query=query or None, data=data or None)
110 if 'X-RateLimit-Remaining' in self.recv_hdrs:
111 newlim = self.recv_hdrs['X-RateLimit-Remaining']
/opt/conda/lib/python3.7/site-packages/fastcore/net.py in urlsend(url, verb, headers, route, query, data, json_data, return_json, return_headers, debug)
210 return urlread(req, decode=False, return_json=False, return_headers=return_headers)
211
--> 212 return urlread(req, return_json=return_json, return_headers=return_headers)
213
214 # Cell
/opt/conda/lib/python3.7/site-packages/fastcore/net.py in urlread(url, data, headers, decode, return_json, return_headers, timeout, **kwargs)
111 with urlopen(url, data=data, headers=headers, timeout=timeout, **kwargs) as u: res,hdrs = u.read(),u.headers
112 except HTTPError as e:
--> 113 if 400 <= e.code < 500: raise ExceptionsHTTP[e.code](e.url, e.hdrs, e.fp) from None
114 else: raise
115
HTTP403ForbiddenError: HTTP Error 403: Forbidden
- Ngôn ngữ chính
- Python
- Star
- 687
- Fork
- 69
- Merge trung bình
- 1 phút
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AnswerDotAI/ghapi
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
AnswerDotAI/ghapi#158 ·
-
Small fix needed to enable GHES Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AnswerDotAI/ghapi#120 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 58/100
AnswerDotAI/ghapi#208 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
AnswerDotAI/ghapi#201 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
AnswerDotAI/ghapi#186 ·
Tất cả issue của AnswerDotAI/ghapi
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stephrobert/dsoxlab#238 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
sublimehq/package_control#1780 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
nwg-piotr/nwg-displays#145 ·