Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion brus_backend_common/models/lakehouse_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ class LakeHouseModel(ABC):
CSV_NAME: str
FORMAT: LakeHouseModelFormat
PK: str
UNIQUE_CONSTRAINTS: List[(str,)]
# TODO: Add PK and unique constraint validations
UNIQUE_CONSTRAINTS: List[str | (str,)]
MIGRATION_HISTORY: List[str] # must be ordered by earliest to latest

# The schema/structure of the delta table as StructType with StructFields
Expand Down
6 changes: 3 additions & 3 deletions brus_backend_common/models/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DEFCGroup(CSVModel):
TABLE_NAME = "defc_mapping"
DESCRIPTION = "Internal CSV to dynamically group DEFCs together"
CSV_NAME = "DEFC_MAPPING.csv"
PK = "DEFC_CODE"
PK = "code"
UNIQUE_CONSTRAINTS = []
MIGRATION_HISTORY = []

Expand Down Expand Up @@ -70,7 +70,7 @@ class FONBronze(CSVModel):
DESCRIPTION = "Raw FON data pulled from Grants.gov"
CSV_NAME = "funding_opportunity.csv"
PK = "id"
UNIQUE_CONSTRAINTS = [""]
UNIQUE_CONSTRAINTS = ["number"]
MIGRATION_HISTORY = []

STRUCTURE = BaseSchema(
Expand All @@ -96,7 +96,7 @@ class FONGold(CSVModel):
DESCRIPTION = "Processed FON data from FONBronze"
CSV_NAME = "funding_opportunity.csv"
PK = "funding_opportunity_id"
UNIQUE_CONSTRAINTS = []
UNIQUE_CONSTRAINTS = ["funding_opportunity_number"]
MIGRATION_HISTORY = []

STRUCTURE = BaseSchema(
Expand Down
Loading