diff --git a/CHANGELOG.md b/CHANGELOG.md index c1ae262dfd..924dd4a3ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ Here described only the breaking and most significant changes. The full changelog and documentation for all released versions could be found in nicely formatted [commit history](https://github.com/frictionlessdata/frictionless-py/commits/main). + +## v5.18.2 To do + +- [x] adding the `categories` field (https://datapackage.org/standard/table-schema/#categories), which is important for labeling categorical variable values + ## v5.18.1 - feat: add pass_row as configurable parameter for field_update diff --git a/frictionless/schema/field.py b/frictionless/schema/field.py index 5b9f8c3eb5..e1f05186cb 100644 --- a/frictionless/schema/field.py +++ b/frictionless/schema/field.py @@ -58,6 +58,11 @@ class Field(Metadata): is found in the field value then it is set as None. """ + categories: Dict[str, Any] = attrs.field(factory=dict) + """ + A dictionary of value/label categorical values expected in the field. + """ + constraints: Dict[str, Any] = attrs.field(factory=dict) """ A dictionary with rules that constraints the data value permitted for a field. @@ -213,6 +218,9 @@ def value_writer(cell: Any): "type": "array", "items": {"type": "string"}, }, + "categories": { + "type": "object" + }, "constraints": { "type": "object", "properties": {