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

HJ-20 save data categories nested fields #22

Merged
merged 7 commits into from
Nov 5, 2024

Conversation

thingscouldbeworse
Copy link

Part of HJ-20

Description Of Changes

remove stipulation that sub fields can't have data categories

Code Changes

  • remove validation on sub fields

Steps to Confirm

  • run tests

Pre-Merge Checklist

  • All CI Pipelines Succeeded
  • Documentation Updated
  • Issue Requirements are Met
  • Relevant Follow-Up Issues Created
  • Update CHANGELOG.md

src/fideslang/models.py Outdated Show resolved Hide resolved
)

assert field
assert field.data_categories == ["user"]
assert field.fields[0].data_categories == ["user"]
Copy link
Author

Choose a reason for hiding this comment

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

real test here, a nested field can in fact have a category

),
fields=[DatasetField(name="nested_field")],
)
assert_error_message_includes(
Copy link
Author

Choose a reason for hiding this comment

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

If we want users to add data categories to the "non-terminal" nested fields (middle fields, or top level) then this validation needs to be removed and the reverse of this test is now the case

@@ -7,8 +7,8 @@
from .data_uses import DEFAULT_DATA_USES
from .organizations import DEFAULT_ORGANIZATIONS

sort_data_types = (
lambda x: x.parent_key if hasattr(x, "parent_key") and x.parent_key else x.fides_key
sort_data_types = lambda x: (
Copy link
Author

Choose a reason for hiding this comment

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

autoformatter

Copy link

@erosselli erosselli left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for making the changes

@thingscouldbeworse thingscouldbeworse merged commit 2db72de into main Nov 5, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants