Collaboration Models¶
Data models for annotations and shareable reports.
Annotation
dataclass
¶
Represents an annotation (comment) on a finding.
Annotations allow users to add comments, tags, and status updates to individual findings. They support collaboration by enabling team members to discuss and track the resolution of data quality issues.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Unique identifier for the annotation. |
finding_id |
str
|
ID of the finding this annotation is attached to. Typically a hash of finding attributes. |
author |
str
|
Name or identifier of the person who created the annotation. |
timestamp |
datetime
|
When the annotation was created. |
comment |
str
|
Text content of the annotation. |
tags |
list[str]
|
List of tags for categorizing the annotation. |
status |
str | None
|
Optional status update. Valid values: "reviewed", "fixed", "false_positive", or None. |
Example
Create an annotation::
annotation = Annotation(
id="ann_123",
finding_id="finding_456",
author="Alice",
timestamp=datetime.now(),
comment="This looks like a data entry error",
tags=["data-entry", "needs-review"],
status="reviewed"
)
Source code in lavendertown/collaboration/models.py
Functions¶
from_dict
classmethod
¶
Create annotation from dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict[str, Any]
|
Dictionary containing annotation data. |
required |
Returns:
| Type | Description |
|---|---|
'Annotation'
|
Annotation instance initialized with data from the dictionary. |
Source code in lavendertown/collaboration/models.py
to_dict ¶
Convert annotation to dictionary for serialization.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary containing all annotation attributes. |
Source code in lavendertown/collaboration/models.py
ShareableReport
dataclass
¶
Represents a shareable report containing findings, annotations, and rulesets.
Shareable reports allow users to export and share their data quality analysis results with team members. Reports include findings, annotations, and optionally the ruleset used for analysis.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Unique identifier for the report. |
title |
str
|
Human-readable title for the report. |
author |
str
|
Name or identifier of the person who created the report. |
created_at |
datetime
|
When the report was created. |
findings |
list[GhostFinding]
|
List of GhostFinding objects in the report. |
annotations |
list[Annotation]
|
List of Annotation objects associated with findings. |
ruleset |
RuleSet | None
|
Optional RuleSet used for the analysis. |
metadata |
dict[str, Any]
|
Additional metadata about the report (e.g., dataset name, analysis date, etc.). |
Example
Create a shareable report::
report = ShareableReport(
id="report_123",
title="Q4 Data Quality Report",
author="Alice",
created_at=datetime.now(),
findings=[finding1, finding2],
annotations=[annotation1],
ruleset=my_ruleset,
metadata={"dataset": "sales_data.csv"}
)
Source code in lavendertown/collaboration/models.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
Functions¶
from_dict
classmethod
¶
Create report from dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict[str, Any]
|
Dictionary containing report data. |
required |
Returns:
| Type | Description |
|---|---|
'ShareableReport'
|
ShareableReport instance initialized with data from the dictionary. |
Source code in lavendertown/collaboration/models.py
to_dict ¶
Convert report to dictionary for serialization.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary containing all report attributes. |