GoogleCloudPlatform / GoogleCloudPlatform/professional-services-data-validator

Misleading "Column DNE in source" exception

Offen
#1,663 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
524
Forks
171
Ø Merge
5 T. 15 Std.
Gemergte PRs (30 T.)
4

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit dem Validierungspfad, der --hash=* erweitert und die primären Schlüssel des Targets verarbeitet, und reproduziere dann den GCP DMS-Fall mit einer decimal-ROWID-Spalte, die nur im Target vorhanden ist. Die Arbeit ist abgeschlossen, wenn diese Spalte übersprungen wird und die Validierung meldet, dass keine der beiden Tabellen Primärschlüssel hat, mit Testabdeckung für diesen Edge Case.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
databases
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.