Skip to content

Commit

Permalink
support open-ended partitioning dict
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsachs committed Oct 1, 2024
1 parent 8ac7460 commit 3d919f6
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions src/fideslang/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,30 +523,17 @@ def validate_fides_collection_key(value: str) -> str:
FidesCollectionKey = Annotated[str, AfterValidator(validate_fides_collection_key)]


class UserDefinedPartitionWindow(BaseModel):
"""Defines a user-defined partition window"""

start: str
end: str
start_inclusive: bool = True
end_inclusive: bool = True


class PartitionSpecification(BaseModel):
"""Defines partition spec for a collection"""

field: str
windows: Optional[List[UserDefinedPartitionWindow]] = None


class CollectionMeta(BaseModel):
"""Collection-level specific annotations used for query traversal"""

after: Optional[List[FidesCollectionKey]] = None
erase_after: Optional[List[FidesCollectionKey]] = None
skip_processing: Optional[bool] = False
masking_strategy_override: Optional[MaskingStrategyOverride] = None
partitioning: Optional[PartitionSpecification] = None

# partitioning metadata is kept open-ended as it is an experimental feature -
# more strictly defined metadata structures will be supported in the future
partitioning: Optional[Dict] = None


class DatasetCollection(FidesopsMetaBackwardsCompat):
Expand Down

0 comments on commit 3d919f6

Please sign in to comment.