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

Ensure running 'wowutil.py build' twice works #25

Merged
merged 3 commits into from
Feb 12, 2019

Conversation

toolness
Copy link
Contributor

Um, so when I implemented #22, I forgot to make sure that running wowutil.py build twice worked.

It looks like the WoW stuff requires the pg_trgm extension--I'm not really sure why it only complains about this the second time we try building WoW datasets though. So now we install the extension if it doesn't already exist.

It also looks like we need to get rid of at least one function that depends on wow_bldgs before we destroy it, so this does that too. Oy vey!

@toolness
Copy link
Contributor Author

Uggh, I'm now realizing that some of the functions created by WoW also depend on NYCDB tables, which means that updating the nycdb tables by dropping them will likely cause things to explode. We may want to test updating the nycdb tables after loading WoW to make sure nothing explodes. ARGH.

@toolness
Copy link
Contributor Author

Um, so I added a test that ensures that reloading the dependee tables doesn't raise any database errors, and they don't, so my previous comment is wrong, but I'm not really sure why it's wrong. Hmmmm.

@toolness
Copy link
Contributor Author

Oh I think I figured it out! The get_assoc_addrs_from_bbl(text) function was preventing wow_bldgs from being destroyed because wow_bldgs was part of its function signature:

CREATE OR REPLACE FUNCTION get_assoc_addrs_from_bbl(_bbl text)
RETURNS SETOF wow_bldgs AS $$

This is unlike some of the helper functions whose function bodies query other NYCDB tables, but whose function signatures don't depend on them.

That's my working theory now, at least.

@toolness toolness merged commit 9f2346c into master Feb 12, 2019
@toolness toolness deleted the ensure-wow-idempotency branch February 12, 2019 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant