GoogleCloudPlatform / GoogleCloudPlatform/professional-services-data-validator

Misleading "Column DNE in source" exception

Aperta
#1,663 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
524
Fork
171
Merge medio
5g 15h
PR unite (30g)
4

Descrizione

When a table without a primary key is migrated using GCP DMS service a decimal `rowid` column is added to the target as a primary key. This column does not exist in the source.

If the user runs validation on one of these tables with no primary key then they, quite accurately, get the error:
```
raise ValueError(f"Column DNE in source: {column}")
ValueError: Column DNE in source: rowid
```

This is a little misleading though and can cause wasted time trying to understand why the rowid column is part of the `--hash=*` expansion. It turns out it there because of primary key automation.

It would be better if target primary keys were skipped if the columns are not in the source table. Then the user would see a more easily understood exception:
```
No primary keys were provided and neither the source or target tables have primary keys. Please include --primary-keys argument
```

This is a bit of an edge case so not high priority.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dal percorso di validazione che espande --hash=* ed elabora le chiavi primarie del target, quindi riproduci il caso GCP DMS con una colonna decimal di rowid presente solo nel target. Il lavoro è completo quando la colonna viene ignorata e la validazione segnala che nessuna delle due tabelle ha chiavi primarie, con una copertura per questo caso limite.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
databases
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.