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

fix: Primary and example fields have been deprecated in Data Contract Specification v1.1.0. #561

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- When importing in dbt format, add the dbt unique information as a datacontract unique field (#558)

### Changed
- fix: Primary and example fields have been deprecated in Data Contract Specification v1.1.0 (#561)

## [0.10.16] - 2024-12-19

Expand Down
10 changes: 8 additions & 2 deletions datacontract/model/data_contract_specification.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ class Field(pyd.BaseModel):
type: str = None
format: str = None
required: bool = None
primary: bool = None
primary: bool = pyd.Field(
default=None,
deprecated="Removed in Data Contract Specification v1.1.0. Use " "primaryKey instead.",
)
primaryKey: bool = None
unique: bool | None = None
references: str = None
Expand All @@ -169,7 +172,10 @@ class Field(pyd.BaseModel):
values: "Field" = None
precision: int = None
scale: int = None
example: str = None
example: str = pyd.Field(
default=None,
deprecated="Removed in Data Contract Specification v1.1.0. Use " "examples instead.",
)
examples: List[Any] | None = None
quality: List[Quality] | None = []
config: Dict[str, Any] | None = None
Expand Down
Loading