bug: get command incorrectly reports spaces error; evaluate_content_type uses singular URL prefixes
Maintainer thường phản hồi trong vòng 11 ngày
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
- 65/100
Hướng nghiên cứu
Start in tabcmd/commands/datasources_and_workbooks/get_url_command.py at the spaces check and evaluate_content_type, then inspect validate_and_extract_url_parts in datasources_workbooks_views_url_parser.py. Reproduce the Windows runtime value of args.url and confirm the workbook get path, then make content-type detection use the documented plural prefixes and verify that valid URLs work without false space errors.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Observed behaviour
Running tabcmd get "/workbooks/WorkbookWithoutExtract.twbx" --no-certcheck (no spaces in the URL) produces:
The name of the workbook or view to export cannot include spaces. Use the normalized name of the workbook or view as it appears in the URL.
Exiting...
The workbook exists on the server and the URL contains no spaces.
Investigation findings
The spaces check at get_url_command.py:45 (if " " in args.url) should be False for this input. The secondary spaces check in datasources_workbooks_views_url_parser.py:46 (validate_and_extract_url_parts) is unreachable from the workbook get path — it is only called for view-type URLs. The root cause of the observed error has not yet been fully reproduced in isolation; further debugging is needed to confirm what value args.url actually holds at runtime on Windows.
Confirmed latent bug in evaluate_content_type
get_url_command.py:62-64:
valid_content_types = ["workbook", "view", "datasource"] # singular
...
if url.find(content_type) == 0: # matches "workbooks/..." via substring accident
The URL prefixes used in practice are plural (workbooks/, views/, datasources/). The match works by accident because "workbooks/...".find("workbook") == 0, but it is fragile — any URL starting with "workbook" (e.g. a hypothetical "workbookshelf/...") would also match. The correct fix is:
url_prefix_to_content_type = {
"workbooks/": "workbook",
"views/": "view",
"datasources/": "datasource",
}
for prefix, content_type in url_prefix_to_content_type.items():
if url.startswith(prefix):
return content_type
Errors.exit_with_error(logger, message=_("tabcmd.error.bad_request.invalid_content_type").format(url))
Files
tabcmd/commands/datasources_and_workbooks/get_url_command.py—evaluate_content_type(line 57) and spaces check (line 45)tabcmd/commands/datasources_and_workbooks/datasources_workbooks_views_url_parser.py—validate_and_extract_url_parts(line 44)
- Ngôn ngữ chính
- Python
- Star
- 52
- Fork
- 17
- Merge trung bình
- 11 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc 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 tableau/tabcmd
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 11 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 11 ngày
-
feat: publish missing --description flag from tabcmd ClassicCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 11 ngày
-
feat: creategroup missing --role flag from tabcmd ClassicCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 11 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 11 ngày
Tất cả issue của tableau/tabcmd
Issue tương tự
-
good first issue infrastructure
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
kuznia-rdzeni/coreblocks#1135 ·
-
good first issue server
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation priority: high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
a-lex-s/mealie-telegram-bot#54 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
type/test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
SaltedTan/virgil-language-server#218 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
btclib-org/btclib-wallet#541 ·
Maintainer thường phản hồi trong vòng 1 ngày