compute_tags keeps empty tags

Đang mở
#412 1 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

@ahmershahdev đang làm issue này rồi.

Từ ngày 23/11/2026.

  • #413 của @ahmershahdev — đang mở

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
32/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
tooling

Hướng nghiên cứu

Start from the compute_tags implementation and confirm the order of operations: whitespace stripping happens after empty values are filtered out. The issue names the reproduction, compute_tags(["wikipedia"], "a; "), and the place for the regression test, tests/inputs/test_inputs.py. Done means whitespace-only tags never reach the returned set, which unblocks TagsMetadata from --tags "a; b; ". Note that pull request #413 is already open against this, so check it before starting.

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

Mô tả

compute_tags() filters out empty tags before stripping whitespace, so whitespace-only values like " " become empty strings ("") instead of being removed.

For example, compute_tags(["wikipedia"], "a; ") returns {"", "a", "wikipedia"}.

This contradicts the docstring, which says empty values are removed. A scraper that passes the result to TagsMetadata (for example from --tags "a; b; ") gets ValueError: Missing value (empty not allowed).

Proposed fix: strip whitespace from each tag before filtering out empty values, and add a test case in tests/inputs/test_inputs.py to cover whitespace-only tags.

Ngôn ngữ chính
Python
Star
33
Fork
34
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
24

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 openzim/python-scraperlib

Tất cả issue của openzim/python-scraperlib

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.