Model is missing but sqlmesh plan/run is successful

Offen
#5,765 10 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 4 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
Ein halber Tag
Anfängerfreundlichkeit
50/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
postgresql, python, sql
Bereich
databases

Rechercherichtung

Start from the model state tracking logic to understand how SQLMesh determines if a model needs to be recreated. The issue is that patient_management.v_patient_insurance is not being recreated even though it doesn't exist in PostgreSQL. Look at the code that decides whether a model is 'missing' and needs recreation, and the view creation execution logic.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Hi!

We have model patient_management.v_patient_insurance in sqlmesh but it's not created. Plan or Run, doesn't re-create etc and there is no error as well.

We can delete and then re-add it and it will be created but don't know why SQLMesh is not able to identify it.

SQL Error [42P01]: ERROR: relation "patient_management.v_patient_insurance" does not exist
  Position: 15

Error position: line: 1740 pos: 14
dotenvx run -- sqlmesh run --skip-janitor --ignore-cron --select-model="patient_management.v_patient_insurance"
⟐ injected env (1) from .env · [email protected]
[v1.0.0] Copy to blob: Object=dbo.vm_SaviPatientInsurance;Blob=;Container=reports-savi
[v1.0.0] Updating fields of table: Name="postgres"."sqlmesh__data_pipeline"."data_pipeline__ext_pt_ins__2065245981"
[v1.0.0] Analyzing table: Name="postgres"."sqlmesh__data_pipeline"."data_pipeline__ext_pt_ins__2065245981"
[1/1] data_pipeline.ext_pt_ins                   [full refresh]                             7.04s   
[1/1] data_pipeline.external_patient_insurance   [recreate view]                            2.92s   
[1/1] patient_management.v_patient_insurance     [recreate view]                            1.46s   
Executing model batches ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% • 3/3 • 0:00:26                                                                                                                   
                                                                                                                                                                                                          
✔ Model batches executed

Run finished for environment 'prod'

Thanks

Vorherrschende Sprache
Python
Sterne
3.3k
Forks
471
Ø Merge
6 T. 7 Std.
Gemergte PRs (30 T.)
35

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus SQLMesh/sqlmesh

Alle Issues in SQLMesh/sqlmesh

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

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