Skip to content

Commit f1646f5

Browse files
authored
Merge pull request #35 from ethyca/add-redact-metadata
Adding redact fides meta
2 parents a57a4cb + 793bc98 commit f1646f5

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ The types of changes are:
1616

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

19+
### Added
20+
- Added `fides_meta.redact` to datasets, collections, and fields [#35](https://github.com/ethyca/fideslang/pull/35)
21+
22+
## [3.1.1](https://github.com/ethyca/fideslang/compare/3.1.0...3.1.1)
23+
1924
### Changed
2025
- Updated the type for `CollectionMeta.partitioning` to allow a list of dicts [#34](https://github.com/ethyca/fideslang/pull/34)
2126

src/fideslang/models.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from datetime import datetime
99
from enum import Enum
10-
from typing import Annotated, Any, Dict, List, Optional, Union
10+
from typing import Annotated, Any, Dict, List, Optional, Union, Literal
1111
from warnings import warn
1212

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

425429
@field_validator("data_type")
426430
@classmethod
@@ -532,6 +536,10 @@ class CollectionMeta(BaseModel):
532536
# partitioning metadata is kept open-ended as it is an experimental feature -
533537
# more strictly defined metadata structures will be supported in the future
534538
partitioning: Optional[Union[Dict, List[Dict]]] = None
539+
redact: Optional[Literal["name"]] = Field(
540+
default=None,
541+
description="Specify 'name' to indicate the collection name should be redacted.",
542+
)
535543

536544

537545
class DatasetCollection(FidesopsMetaBackwardsCompat):
@@ -596,6 +604,10 @@ class DatasetMetadata(BaseModel):
596604
resource_id: Optional[str] = None
597605
after: Optional[List[FidesKey]] = None
598606
namespace: Optional[Dict] = None
607+
redact: Optional[Literal["name"]] = Field(
608+
default=None,
609+
description="Specify 'name' to indicate the dataset name should be redacted.",
610+
)
599611

600612

601613
class Dataset(FidesModel, FidesopsMetaBackwardsCompat):

0 commit comments

Comments
 (0)