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

Populate sba ref data #92

Merged
merged 10 commits into from
Aug 15, 2023
Merged

Populate sba ref data #92

merged 10 commits into from
Aug 15, 2023

Conversation

rmarow
Copy link
Contributor

@rmarow rmarow commented Aug 15, 2023

resolves #89

],
'Terrestrial and Freshwater Living Resources': [
'Assess and manage land cover and land use in a sustainable manner',
# 'Characterize and assess the status and trends of Arctic and'
Copy link
Contributor Author

@rmarow rmarow Aug 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "pk_societal_benefit_key_objective" DETAIL: Key (id)=(Manage Arctic and migratory living resources in a sustainable manner) already exists

These gave the error pasted above because the exact same value exists under another sub-area. Not sure what the best method is to proceed here. - maybe asking Hazel?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To ensure I grok:

Marine and Coastal Living Resources and Terrestrial and Freshwater Living Resources are both sub-areas, and they both have one key objective which is identical between them?

I think we need to add the sub-area to the primary key of the key objectives table. I think that should only require a model change, no logic change. What do you think?

@rmarow rmarow marked this pull request as ready for review August 15, 2023 17:46
@rmarow
Copy link
Contributor Author

rmarow commented Aug 15, 2023

NOTE: I could not find a db.populate_reference_data or db.load_reference_data script so i ultimately ran db.init if that exists please point me to it, otherwise we may need to add an issue for that.

@MattF-NSIDC
Copy link
Member

There is a task: https://github.com/nsidc/usaon-vta-survey/blob/main/tasks/db.py#L29-L43

I don't have any ideas about why it may not be showing up for you at the moment :(

Copy link
Member

@MattF-NSIDC MattF-NSIDC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whew, that's a lot of data! 😅

Thanks for going through this tedium. I mostly skimmed, looks good. If anything slipped by us, we'll know when we have users testing :)

@rmarow rmarow merged commit 383e68a into main Aug 15, 2023
2 checks passed
@rmarow rmarow deleted the populate_SBA_ref_data branch August 15, 2023 20:21
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.

Populate SBA reference data
2 participants