Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task hvmv_substation fails due to missing table #872

Closed
nesnoj opened this issue Aug 19, 2022 · 13 comments
Closed

Task hvmv_substation fails due to missing table #872

nesnoj opened this issue Aug 19, 2022 · 13 comments
Assignees
Labels
🐛 bug Something isn't working

Comments

@nesnoj
Copy link
Member

nesnoj commented Aug 19, 2022

2 clean runs of continuous-integration/run-everything-over-the-weekend-2022-06-10 (head: 740f279) for DE lead to the same error:

psycopg2.errors.UndefinedTable: relation "grid.egon_hvmv_substation" does not exist

Apparently, you did some renaming/changed import of the HV/MV substation table in #860.
The table should have been created in osmtgmod substation but èxtract() may never been called? @ClaraBuettner

@nesnoj nesnoj added the 🐛 bug Something isn't working label Aug 19, 2022
@nesnoj
Copy link
Member Author

nesnoj commented Aug 19, 2022

BTW, grid.egon_ehv_substation is not created either

@ClaraBuettner
Copy link
Contributor

ClaraBuettner commented Aug 19, 2022

Sorry, I forgot to change the table name in two lines of the hvmv-substation script, this should be fixed in b2376c2.

I also merged this branch into CI again.

@ClaraBuettner
Copy link
Contributor

BTW, grid.egon_ehv_substation is not created either

These tables are now created in the osmtgmod dataset. The substation-dataset creates and fills the grid.egon_hvmv_transfer_buses and grid.egon_ehv_transfer_buses tables. Before these changes, the tables were filled in one dataset and updated by another one which resulted into problems when one of them was skipped due to versioning.

@nesnoj
Copy link
Member Author

nesnoj commented Aug 19, 2022

Thanks for the quick fix, I'll give it another try

@nesnoj
Copy link
Member Author

nesnoj commented Aug 19, 2022

Seems to work out

@nesnoj nesnoj closed this as completed Aug 19, 2022
@nesnoj
Copy link
Member Author

nesnoj commented Aug 24, 2022

Now I'm getting psycopg2.errors.UndefinedTable: table "egon_mv_grid_district" does not exist in the task mv_grid_districts.define-mv-grid-districts (HEAD: 5e0ab3b).

It is raised in these lines. @ClaraBuettner you added this drop statement recently. It does not check if the table actually exists. To my mind it can be removed as in L572 there's already a drop statement for this table (which, btw, checks for existence).

@nesnoj nesnoj reopened this Aug 24, 2022
@nesnoj
Copy link
Member Author

nesnoj commented Aug 24, 2022

After removing those lines the task finishes successfully

@ClaraBuettner
Copy link
Contributor

I changed this in #859. Dropping without CASCADE resulted into problems because the eMobility-dataset has a ForeignKey to the mv grids.
I can add IF EXISTS to the drop statement.

@nesnoj
Copy link
Member Author

nesnoj commented Aug 24, 2022

I see, yes that would be nice if you added IF EXISTS.

And could you please delete the ORM drop statement then?

PS: It would be also possible to keep the ORM statement and define the cascade in the foreign key relationship but I had troubles in the past and don't wanna mess around with this again.

@ClaraBuettner
Copy link
Contributor

I see, yes that would be nice if you added IF EXISTS.

And could you please delete the ORM drop statement then?

Done in 8cab0bf

@nesnoj
Copy link
Member Author

nesnoj commented Aug 24, 2022

thx

@nesnoj nesnoj closed this as completed Aug 24, 2022
@nesnoj
Copy link
Member Author

nesnoj commented Aug 24, 2022

Just a sec, you also dropped MvGridDistricts.__table__.create(bind=engine), please keep this ;)

@nesnoj nesnoj reopened this Aug 24, 2022
@ClaraBuettner
Copy link
Contributor

Just a sec, you also dropped MvGridDistricts.__table__.create(bind=engine), please keep this ;)

Sorry for my confusion, I fixed it again...

@nesnoj nesnoj closed this as completed Aug 24, 2022
@nesnoj nesnoj mentioned this issue Aug 30, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants