bug: get command incorrectly reports spaces error; evaluate_content_type uses singular URL prefixes
I maintainer di solito rispondono entro 11 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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)
- Lingua principale
- Python
- Stelle
- 52
- Fork
- 17
- Merge medio
- 11g 11h
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tableau/tabcmd
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 11 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 11 giorni
-
feat: publish missing --description flag from tabcmd ClassicForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 11 giorni
-
feat: creategroup missing --role flag from tabcmd ClassicForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 11 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 11 giorni
Tutte le issue di tableau/tabcmd
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
WLAN-Pi/wlanpi-profiler#341 ·
I maintainer di solito rispondono entro 1 giorno
-
Memory leak: the shared `validation_aborted_error` keeps every traceback it is raised throughForse già presa @Fire162 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
graphql-python/graphql-core#287 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
roman-corgi/ctc-dip#160 ·
I maintainer di solito rispondono entro 1 giorno
-
type-bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
render_findings.py reads and writes in the host's default encoding, so findings.html breaks on a cp1252 Windows hostForse già presa @Aaqibhafeezkhan l’ha presa oggi. Apertabug good first issue mentored python size: XS up-for-grabs
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
dheerajjha/mcp-migrate#366 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno