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

Minor fix to TaxonomyEntry type & initial data loading #138

Merged
merged 1 commit into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/core/ingestion/metadata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Mapping, Sequence, Union, Optional
from typing import Any, Mapping, Sequence, Union

from pydantic.dataclasses import dataclass
from pydantic.config import ConfigDict, Extra
Expand All @@ -13,7 +13,7 @@ class TaxonomyEntry:

allow_blanks: bool
allowed_values: Sequence[str]
allow_any: Optional[bool] = False
allow_any: bool = False


Taxonomy = Mapping[str, TaxonomyEntry]
Expand Down
2 changes: 2 additions & 0 deletions app/data_migrations/populate_taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def populate_org_taxonomy(
)
db.add(org)
db.flush()
db.commit()

metadata_org = (
db.query(MetadataOrganisation)
Expand All @@ -46,6 +47,7 @@ def populate_org_taxonomy(
)
)
db.flush()
db.commit()


def populate_taxonomy(db: Session) -> None:
Expand Down