Skip to content
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ The types of changes are:

## [Unreleased](https://github.com/ethyca/fideslang/compare/3.1.0...main)

### Added
- Added `fides_meta.redact` to datasets, collections, and fields [#35](https://github.com/ethyca/fideslang/pull/35)

## [3.1.1](https://github.com/ethyca/fideslang/compare/3.1.0...3.1.1)

### Changed
- Updated the type for `CollectionMeta.partitioning` to allow a list of dicts [#34](https://github.com/ethyca/fideslang/pull/34)

Expand Down
14 changes: 13 additions & 1 deletion src/fideslang/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from datetime import datetime
from enum import Enum
from typing import Annotated, Any, Dict, List, Optional, Union
from typing import Annotated, Any, Dict, List, Optional, Union, Literal
from warnings import warn

from packaging.version import InvalidVersion, Version
Expand Down Expand Up @@ -421,6 +421,10 @@ class FidesMeta(BaseModel):
default=None,
description="Optionally specify a masking strategy override for this field.",
)
redact: Optional[Literal["name"]] = Field(
default=None,
description="Specify 'name' to indicate the field name should be redacted.",
)

@field_validator("data_type")
@classmethod
Expand Down Expand Up @@ -532,6 +536,10 @@ class CollectionMeta(BaseModel):
# 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[Union[Dict, List[Dict]]] = None
redact: Optional[Literal["name"]] = Field(
default=None,
description="Specify 'name' to indicate the collection name should be redacted.",
)


class DatasetCollection(FidesopsMetaBackwardsCompat):
Expand Down Expand Up @@ -596,6 +604,10 @@ class DatasetMetadata(BaseModel):
resource_id: Optional[str] = None
after: Optional[List[FidesKey]] = None
namespace: Optional[Dict] = None
redact: Optional[Literal["name"]] = Field(
default=None,
description="Specify 'name' to indicate the dataset name should be redacted.",
)


class Dataset(FidesModel, FidesopsMetaBackwardsCompat):
Expand Down
Loading