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

Bump Pydantic to version 2 #160

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6891ade
Bump Pydantic to version 2
ThomasLaPiana Sep 7, 2023
c491758
Add Pydantic 2 to Action Matrix
ThomasLaPiana Sep 8, 2023
153bf2d
checkin
ThomasLaPiana Nov 10, 2023
7693bcb
feat: remove data qualifiers
ThomasLaPiana Nov 10, 2023
3e486b1
feat: more qualifier removals
ThomasLaPiana Nov 10, 2023
7371ff7
Merge branch 'ThomasLaPiana-remove-data-qualifiers' into ThomasLaPian…
ThomasLaPiana Nov 10, 2023
20a0785
fix: mypy and pylint
ThomasLaPiana Nov 10, 2023
d55e284
fix more failing tests
ThomasLaPiana Nov 13, 2023
5f2c86c
fix version and fides_key validation test failures
ThomasLaPiana Nov 13, 2023
a718e17
fix missing defaults
ThomasLaPiana Nov 13, 2023
c329f44
clean up more test failures
ThomasLaPiana Nov 13, 2023
bfb8d3d
fix more errors
ThomasLaPiana Nov 13, 2023
25e5b80
fix parent key validation
ThomasLaPiana Nov 14, 2023
73edf8b
get everything passing (by removing two tests)
ThomasLaPiana Nov 14, 2023
126e4be
feat: update CI checks for new pydantic versions
ThomasLaPiana Nov 14, 2023
cc4d782
update requirements file, remove python 3.8 and add 3.12 to supported…
ThomasLaPiana Nov 14, 2023
ba08cf1
remove python 3.12 from the matrix
ThomasLaPiana Nov 14, 2023
12ef6a8
fix static checks
ThomasLaPiana Nov 14, 2023
63d2795
docs: changelog
ThomasLaPiana Nov 14, 2023
40d4faa
re-add tests and fix privacy declaration checks
ThomasLaPiana Nov 27, 2023
d82bf8c
Merge branch 'fideslang-3' into ThomasLaPiana-bump-pydantic-2
ThomasLaPiana Nov 27, 2023
537537c
fix flexible default test
ThomasLaPiana Nov 27, 2023
191f6df
fix static checks
ThomasLaPiana Nov 27, 2023
9ec615a
fix the validators on our custom fideskey types to be json schema valid
ThomasLaPiana Nov 28, 2023
43abfb7
turned off strict checking for the registry id
ThomasLaPiana Nov 28, 2023
e7de840
add more None defaults to optional types
ThomasLaPiana Nov 30, 2023
a66a4ce
remove all uses of URL since they might cause issues with database st…
ThomasLaPiana Nov 30, 2023
557aebf
remove a validator on System that caused issues when loading from Orm…
ThomasLaPiana Nov 30, 2023
b87a229
remove deprecation tests and update model (root) validators
ThomasLaPiana Nov 30, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
strategy:
matrix:
python_version: ["3.8", "3.9", "3.10", "3.11"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 3.8 wasn't playing nicely, so I axed it. It is almost EOL and we can only make the matrix so large

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood, how do we generally communicate things like this to customers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than changelog, it'll automatically fail to pip install if they have an older version.

Afaik most people are using Docker containers, this would be most disruptive to customers using the CLI

pydantic_version: ["1.8.2", "1.9.2", "1.10.9"]
pydantic_version: ["2.3.0"]
pyyaml_version: ["5.4.1", "6.0"]
runs-on: ubuntu-latest
continue-on-error: true
Expand Down
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,6 @@ Examples of a Data Subject are:

Learn more about [Data Subject Categories in the taxonomy reference now](https://ethyca.github.io/fideslang/taxonomy/data_subjects/).

### 4. Data Identification Qualifiers

Data Identification Qualifiers describe the degree of identification of the given data.
Think of this as a spectrum: on one end is completely anonymous data, i.e. it is impossible to identify an individual from it; on the other end is data that specifically identifies an individual.

Along this spectrum are labels that describe the degree of identification that a given data might provide, such as:

- `identified_data`
- `anonymized_data`
- `aggregated_data`

Learn more about [Data Identification Qualifiers in the taxonomy reference now](https://ethyca.github.io/fideslang/taxonomy/data_qualifiers/).

### Extensibility & Interoperability

The taxonomy is designed to support common privacy compliance regulations and standards out of the box, these include GDPR, CCPA, LGPD and ISO 19944.
Expand Down
10 changes: 0 additions & 10 deletions demo_resources/demo_dataset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ dataset:
description: Data collected about users for our analytics system.
meta: null
data_categories: []
data_qualifiers:
- aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
retention: "30 days after account deletion"
third_country_transfers:
- GBR
Expand All @@ -15,37 +13,29 @@ dataset:
- name: users
description: User information
data_categories: []
data_qualifiers:
- aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
fields:
- name: created_at
description: User's creation timestamp
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: email
description: User's Email
data_categories:
- user.contact.email
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
retention: Account termination
- name: first_name
description: User's first name
data_categories:
- user.name
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
retention: Account termination
- name: food_preference
description: User's favorite food
data_categories: []
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: state
description: User's State
data_categories:
- user.contact.state
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: uuid
description: User's unique ID
data_categories:
- user.unique_id
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
1 change: 0 additions & 1 deletion demo_resources/demo_policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ policy:
matches: ANY
values:
- customer
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
2 changes: 0 additions & 2 deletions demo_resources/demo_system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ system:
data_use: improve.system
data_subjects:
- customer
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
ingress:
- demo_users_dataset

Expand All @@ -40,4 +39,3 @@ system:
data_use: advertising
data_subjects:
- customer
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
4 changes: 0 additions & 4 deletions mkdocs/docs/explorer.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ The taxonomy explorer is a useful way to visualize and review the taxonomy for t
<button class="btn is-selected" data-chart-data="categories">Data Categories</button>
<button class="btn" data-chart-data="uses">Data Uses</button>
<button class="btn" data-chart-data="subjects">Data Subjects</button>
<button class="btn" data-chart-data="qualifiers">Data Qualifiers</button>
</div>
</div>
<div id="chart-type-control" class="control-group">
Expand All @@ -35,6 +34,3 @@ The taxonomy explorer is a useful way to visualize and review the taxonomy for t
</div>
<script src="https://d3js.org/d3.v7.min.js"></script>
<script src="../js/vis2.js"></script>



17 changes: 2 additions & 15 deletions mkdocs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ The Fides taxonomy, or categorization, is made up of four main classification gr
<button class="btn is-selected" data-chart-data="categories">Data Categories</button>
<button class="btn" data-chart-data="uses">Data Uses</button>
<button class="btn" data-chart-data="subjects">Data Subjects</button>
<button class="btn" data-chart-data="qualifiers">Data Qualifiers</button>
</div>
</div>
<div id="chart-type-control" class="control-group">
Expand Down Expand Up @@ -59,6 +58,7 @@ Data Uses are also hierarchical with natural inheritance, meaning you can easily
Learn more about [Data Uses in the taxonomy reference now](taxonomy/data_uses.md).

### 3. Data Subjects

Data Subjects is a label commonly used in the regulatory world to describe the users of a system who's data is being processed. In many systems a generic user label may be sufficient, however the taxonomy is intended to provide greater control through specificity where needed.

Examples of this are:
Expand All @@ -71,23 +71,10 @@ Examples of this are:

Learn more about [Data Subjects in the taxonomy reference now](taxonomy/data_subjects.md).

### 4. Data Qualifiers
Data Qualifiers describe the degree of identification of the given data. Think of this as a spectrum: on one end is completely anonymous data, i.e. it is impossible to identify an individual from it, and on the other end is data that specifically identifies an individual.

Along this spectrum are labels that describe the degree of identification that a given data might provide, such as:

- `identified`
- `anonymized`
- `aggregated`

Learn more about [Data Qualifiers in the taxonomy reference now](taxonomy/data_qualifiers.md).

### Extensibility and Interoperability

The taxonomy is designed to support common privacy compliance regulations `and standards out of the box, these include GDPR, CCPA, LGPD and ISO 19944.

You can extend the taxonomy to support your system needs. If you do this, we recommend extending from the existing class structures to ensure interoperability inside and outside your organization.

If you have suggestions for missing classifications or concepts, please submit them for addition.



23 changes: 1 addition & 22 deletions mkdocs/docs/js/vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,7 @@ Promise.all([
d3.csv("csv/data_categories.csv"),
d3.csv("csv/data_uses.csv"),
d3.csv("csv/data_subjects.csv"),
d3.csv("csv/data_qualifiers.csv"),
]).then(([categoriesCSV, usesCSV, subjectsCSV, qualifiersCSV]) => {
]).then(([categoriesCSV, usesCSV, subjectsCSV]) => {
const tooltip = new VisTooltip();

const colors = {
Expand Down Expand Up @@ -820,24 +819,6 @@ Promise.all([
"#f73ffc",
"#fb409e",
]),
qualifiers: d3
.scaleOrdinal()
.domain([
"data_qualifier",
"aggregated",
"aggregated.anonymized",
"aggregated.anonymized.unlinked_pseudonymized",
"aggregated.anonymized.unlinked_pseudonymized.pseudonymized",
"aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified",
])
.range([
"#2a3045",
"#0861ce",
"#8459cc",
"#c14cbb",
"#ed43a0",
"#ff4a7f",
]),
};

const accessor = {
Expand All @@ -859,13 +840,11 @@ Promise.all([
const categoriesRoot = stratify(categoriesCSV);
const usesRoot = stratify(usesCSV);
const subjectsRoot = stratify(subjectsCSV);
const qualifiersRoot = stratify(qualifiersCSV);

const chartData = {
categories: categoriesRoot,
uses: usesRoot,
subjects: subjectsRoot,
qualifiers: qualifiersRoot,
};
const chartDataButtons = d3
.select("#data-control")
Expand Down
23 changes: 1 addition & 22 deletions mkdocs/docs/js/vis2-absolute.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,7 @@ Promise.all([
d3.csv("https://ethyca.github.io/fideslang/csv/data_categories.csv"),
d3.csv("https://ethyca.github.io/fideslang/csv/data_uses.csv"),
d3.csv("https://ethyca.github.io/fideslang/csv/data_subjects.csv"),
d3.csv("https://ethyca.github.io/fideslang/csv/data_qualifiers.csv"),
]).then(([categoriesCSV, usesCSV, subjectsCSV, qualifiersCSV]) => {
]).then(([categoriesCSV, usesCSV, subjectsCSV]) => {
const tooltip = new VisTooltip();

const colors = {
Expand Down Expand Up @@ -820,24 +819,6 @@ Promise.all([
"#f73ffc",
"#fb409e",
]),
qualifiers: d3
.scaleOrdinal()
.domain([
"data_qualifier",
"aggregated",
"aggregated.anonymized",
"aggregated.anonymized.unlinked_pseudonymized",
"aggregated.anonymized.unlinked_pseudonymized.pseudonymized",
"aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified",
])
.range([
"#2a3045",
"#0861ce",
"#8459cc",
"#c14cbb",
"#ed43a0",
"#ff4a7f",
]),
};

const accessor = {
Expand All @@ -859,13 +840,11 @@ Promise.all([
const categoriesRoot = stratify(categoriesCSV);
const usesRoot = stratify(usesCSV);
const subjectsRoot = stratify(subjectsCSV);
const qualifiersRoot = stratify(qualifiersCSV);

const chartData = {
categories: categoriesRoot,
uses: usesRoot,
subjects: subjectsRoot,
qualifiers: qualifiersRoot,
};
const chartDataButtons = d3
.select("#data-control")
Expand Down
23 changes: 1 addition & 22 deletions mkdocs/docs/js/vis2.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,7 @@ Promise.all([
d3.csv("../csv/data_categories.csv"),
d3.csv("../csv/data_uses.csv"),
d3.csv("../csv/data_subjects.csv"),
d3.csv("../csv/data_qualifiers.csv"),
]).then(([categoriesCSV, usesCSV, subjectsCSV, qualifiersCSV]) => {
]).then(([categoriesCSV, usesCSV, subjectsCSV]) => {
const tooltip = new VisTooltip();

const colors = {
Expand Down Expand Up @@ -820,24 +819,6 @@ Promise.all([
"#f73ffc",
"#fb409e",
]),
qualifiers: d3
.scaleOrdinal()
.domain([
"data_qualifier",
"aggregated",
"aggregated.anonymized",
"aggregated.anonymized.unlinked_pseudonymized",
"aggregated.anonymized.unlinked_pseudonymized.pseudonymized",
"aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified",
])
.range([
"#2a3045",
"#0861ce",
"#8459cc",
"#c14cbb",
"#ed43a0",
"#ff4a7f",
]),
};

const accessor = {
Expand All @@ -859,13 +840,11 @@ Promise.all([
const categoriesRoot = stratify(categoriesCSV);
const usesRoot = stratify(usesCSV);
const subjectsRoot = stratify(subjectsCSV);
const qualifiersRoot = stratify(qualifiersCSV);

const chartData = {
categories: categoriesRoot,
uses: usesRoot,
subjects: subjectsRoot,
qualifiers: qualifiersRoot,
};
const chartDataButtons = d3
.select("#data-control")
Expand Down
6 changes: 0 additions & 6 deletions mkdocs/docs/resources/dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ An optional array of contact information if a Joint Controller exists. This info
An optional string to describe the retention policy for a dataset. This field can also be applied more granularly at either the Collection or field level of a Dataset

**data_categories**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[_string_]<br/>
**data_qualifiers**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[_string_]<br/>

Arrays of Data Category and Data Qualifier resources, identified by `fides_key`, that apply to all collections in the Dataset.

Expand All @@ -73,7 +72,6 @@ A UI-friendly label for the collection.
A human-readable description of the collection.

**collections.data_categories**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[_string_]<br/>
**collections.data_qualifiers**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[_string_]<br/>

Arrays of Data Category and Data Qualifier resources, identified by `fides_key`, that apply to all fields in the collection.

Expand All @@ -97,10 +95,6 @@ A human-readable description of the field.

Arrays of Data Categories, identified by `fides_key`, that applies to this field.

**collections.fields.data_qualifier**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_string_<br/>

A Data Qualifier that applies to this field. Note that this field holds a single value, therefore, the property name is singular.

**collections.fields.retention**<span class="required"/>&nbsp;&nbsp;_string_

An optional string to describe the retention policy for a field within a Dataset collection.
Expand Down
8 changes: 1 addition & 7 deletions mkdocs/docs/resources/policy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Policy

A Policy is your privacy policy as code, it lists a set of acceptable and non-acceptable rules and uses all 4 privacy attributes (`data_category`, `data_use`, `data_subject`, and `data_qualifier`). The purpose of the policy is to state what types of data are allowed for certain usages.
A Policy is your privacy policy as code, it lists a set of acceptable and non-acceptable rules and uses all 3 privacy attributes (`data_category`, `data_use`, `data_subject`). The purpose of the policy is to state what types of data are allowed for certain usages.

```
organization
Expand Down Expand Up @@ -34,10 +34,6 @@ The [Data Use](../../taxonomy/data_uses/) privacy attribute describes the variou

The [Data Subjects](../../taxonomy/data_subjects/) privacy attribute describes the individual persons whose data your rule pertains to.

**data_qualifier**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_string_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

The [Data Qualifier](../../taxonomy/data_qualifiers/) privacy attribute describes the acceptable or non-acceptable level of deidentification for this data.

**matches**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_enum_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

* `ANY`
Expand Down Expand Up @@ -76,7 +72,6 @@ policy:
matches: ANY
values:
- customer
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
```

**Demo manifest file:** `/fides/demo_resources/demo_policy.yml`
Expand Down Expand Up @@ -113,7 +108,6 @@ policy:
"customer"
]
},
"data_qualifier": "aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified"
}
]
}
Expand Down
6 changes: 2 additions & 4 deletions mkdocs/docs/resources/system.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# System

A System is a model for describing anything that processes data for your organization (applications, services, 3rd party APIs, etc.) and describes how these datasets are used for business functions of instances of your data resources. It contains all 4 privacy attributes (`data_category`, `data_use`, `data_subject`, and `data_qualifier`).
A System is a model for describing anything that processes data for your organization (applications, services, 3rd party APIs, etc.) and describes how these datasets are used for business functions of instances of your data resources. It contains all 3 privacy attributes (`data_category`, `data_use`, and `data_subject`).

```
organization
Expand Down Expand Up @@ -64,7 +64,7 @@ The resources from which the System receives data.

**privacy_declarations**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[array]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

The array of declarations describing the types of data in your system. This is a list of the privcy attributes (`data_category`, `data_use`, `data_subject`, and `data_qualifier`) for each of your systems.
The array of declarations describing the types of data in your system. This is a list of the privcy attributes (`data_category`, `data_use`, and `data_subject`) for each of your systems.

If a dataset is referenced as part of the system, all applicable data categories set on the dataset are treated as part of the system.

Expand Down Expand Up @@ -114,7 +114,6 @@ system:
data_use: improve.system
data_subjects:
- customer
data_qualifier: identified_data
egress:
- another_demo_system
ingress:
Expand Down Expand Up @@ -166,7 +165,6 @@ system:
"data_subjects": [
"customer"
],
"data_qualifier": "identified_data",
"egress": ["another_demo_system"],
"ingress": ["yet_another_demo_system"]
}
Expand Down
Loading
Loading