SQL Lab: pasting text that matches no database into the "Data connection" select throws TypeError
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 75/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
Leggi src/components/DatabaseSelector/index.tsx e packages/superset-ui-core/src/components/Select/AsyncSelect.tsx, concentrandoti su changeDatabase, onPaste e fireOnChange. Riproduci il problema incollando testo non corrispondente nel campo vuoto «Data connection» di SQL Lab. La modifica è completa quando l’incolla non causa più il TypeError e il testo non corrispondente viene ignorato o trattato soltanto come termine di ricerca; aggiungi o aggiorna il test frontend pertinente se il repository dispone di copertura per questi componenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug description
In SQL Lab's "Select Database and Schema" popover, pasting text that doesn't match any database into the empty "Data connection" field shows a red error overlay:
TypeError: Cannot read properties of undefined (reading 'value')
How to reproduce
- Open SQL Lab and click the database selector ("Select Database and Schema")
- Click the empty "Data connection" field
- Paste any text that is not a database name (e.g.
abc)
Expected
No error. The pasted text should be ignored or used as a search term.
Actual
Error overlay with the TypeError above.
Not affected
- Typing the same text
- Pasting the exact name of an existing database (
examples) - Pasting when a database is already selected
Stack trace (top frames)
changeDatabase—src/components/DatabaseSelector/index.tsxeval—packages/superset-ui-core/src/components/Select/AsyncSelect.tsx(effect that callsonChange)
Possible cause
In single-select mode, onPaste in AsyncSelect.tsx calls fireOnChange() even when getPastedTextValue returns undefined. The effect then calls onChange(selectValue, options[0]) with options[0] undefined, and changeDatabase reads database.value without a guard.
I'd like to work on this. Which fix would maintainers prefer: skip fireOnChange() when the paste matched nothing, or guard changeDatabase?
Screenshots/recordings
Superset version
master / latest-dev
Python version
Not applicable
Node version
18 or greater
Browser
Chrome
Additional context
Tested on master commit 7819e820 (Docker dev setup, docker compose).
Checklist
- I have searched Superset docs and Slack and didn't find a solution to my problem.
- I have searched the GitHub issue tracker and didn't find a similar bug report.
- I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
- Lingua principale
- Python
- Stelle
- 75.6k
- Fork
- 18.6k
- Merge medio
- 4g 2h
- PR unite (30g)
- 469
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un 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 apache/superset
-
#bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
apache/superset#46567 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
🦾 ai-candidate
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/superset#46238 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Explore filter: multi-select value list with allowNewOptions stops accepting values and drops earlier onesForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta🦾 ai-candidate
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/superset#46146 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
[Bug] Table chart applies Time grain to only the first temporal column (regression from 4.0.2)Forse già presa @PrakharAgarwal17 l’ha presa 24 giorni fa. Aperta#bug 🦾 ai-candidate
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/superset#45964 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Stacked "Only Total" still includes the sort-only metric on time-comparison charts (follow-up to #42881)Forse già presa @waterWang l’ha presa 109 giorni fa. Apertaviz:charts:timeseries
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/superset#43068 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di apache/superset
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
bug crash needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Community-Access/quill#2135 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
munendra07-tech/agent-crashtest#20 ·
I maintainer di solito rispondono entro 1 giorno
-
braveapi: time range filter is sent as time_range, which the Brave API ignores (needs freshness)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
request_access
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100