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

Developer Knowledge fallback search response is not iterable

Đang mở Phù hợp với người mới
#14,609 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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
88/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend, testing

Hướng nghiên cứu

Bắt đầu với developer-knowledge/conftest.py để kiểm tra SearchDocumentChunksResponse dự phòng, sau đó so sánh hành vi của nó với vòng lặp trong developer-knowledge/search_document_chunks.py. Chạy python -m pytest developer-knowledge -q; hoàn tất nghĩa là cả bốn bài kiểm thử tập trung đều đạt và phản hồi dự phòng có thể được vòng lặp phân trang của mẫu sử dụng.

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

Mô tả

samples

In which file did you encounter the issue?

developer-knowledge/conftest.py and developer-knowledge/search_document_chunks.py

Did you change the file? If so, how?

No.

Describe the issue

The Developer Knowledge samples include a fallback implementation for environments where the preview client is not installed. The fallback SearchDocumentChunksResponse stores its results but is not iterable, while the sample iterates over the response as a pager.

Reproduction command:

python -m pytest developer-knowledge -q

Result:

3 passed, 1 failed
...
developer-knowledge\\search_document_chunks.py:44: in search_document_chunks
    for chunk in response:
TypeError: 'SearchDocumentChunksResponse' object is not iterable

Expected behavior: all four focused tests pass using the intended fallback. Actual behavior: the search test fails before it can exercise the sample.

Environment: Python 3.12, pytest 9.1.1, repository main at commit 430a87ada6f2d33f318b5d16b77464679905a140.

Ngôn ngữ chính
Jupyter Notebook
Star
8.1k
Fork
6.7k
Merge trung bình
4 ngày 4 giờ
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

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 GoogleCloudPlatform/python-docs-samples

Tất cả issue của GoogleCloudPlatform/python-docs-samples

Issue tương tự

Thêm issue về Backend & API Design

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.