pub struct ProfileReport {
pub schema_version: u32,
pub id: String,
pub timestamp: String,
pub data_source: DataSource,
pub column_profiles: Vec<ColumnProfile>,
pub execution: ExecutionMetadata,
pub quality: Option<QualityAssessment>,
pub quality_status: QualityAnalysisStatus,
pub semantic_hint_bindings: Vec<SemanticHintBinding>,
pub metric_semantics: Option<MetricSemantics>,
}Expand description
Complete profiling report for a data source.
Contains column-level statistics, execution metadata, and an optional
Quality assessment informed by ISO 8000/25012 concepts. This is the primary output of all
profiling operations (Profiler::analyze_file, Profiler::analyze_source,
Profiler::profile_stream, etc.).
Fields§
§schema_version: u32Version of the serialized report schema (see REPORT_SCHEMA_VERSION).
0 means the document predates schema versioning (a 0.9-era report).
Deserialization rejects versions newer than REPORT_SCHEMA_VERSION.
id: StringUnique identifier for this report (UUID v4)
timestamp: StringTimestamp when the report was generated (ISO 8601 / RFC 3339)
data_source: DataSourceData source metadata (file, query, etc.)
column_profiles: Vec<ColumnProfile>Column-level profiling results
execution: ExecutionMetadataExecution metadata (timing, rows processed, truncation info, etc.)
quality: Option<QualityAssessment>Data quality assessment (optional — partial analysis may skip quality)
quality_status: QualityAnalysisStatusWhat happened to the quality computation. Always present: it is the
reason quality is or is not there, and a report must never leave a
failed computation to a log line. Additive field — documents written
before it deserialize as QualityAnalysisStatus::Unrecorded, or as
Computed when they carry an assessment.
This and quality are two halves of one fact:
Computed accompanies an assessment
and every other status accompanies its absence. Construction goes
through ReportAssembler, which derives one
from the other, and deserialization rejects a document that pairs them
any other way. Assigning either field directly can still break the
pair, and such a report serializes into a document this crate will
refuse to read back.
semantic_hint_bindings: Vec<SemanticHintBinding>Per-column evidence of how each semantic hint bound to the data.
Empty when no hints were supplied. Recorded for provenance: a hint proven inert over the full data is rejected before a report is returned, so a successful report only carries bindings that matched something or whose evidence was sampled. Additive field — older readers ignore it.
metric_semantics: Option<MetricSemantics>How this report’s measurements were defined; see MetricSemantics.
Every report this build produces records MetricSemantics::current.
None is a document written before dataprof recorded it, and its
definitions are unknown. Loading and saving keep the value the
document had rather than the reader’s. Additive field.
Implementations§
Source§impl ProfileReport
impl ProfileReport
Sourcepub fn findings(&self) -> FindingsResult
pub fn findings(&self) -> FindingsResult
The findings this report supports under the default thresholds.
Shorthand for FindingPolicy::default().evaluate(self), which cannot
fail because the defaults are in range.
Source§impl ProfileReport
impl ProfileReport
Sourcepub fn to_json(&self) -> Result<String>
pub fn to_json(&self) -> Result<String>
Serialize the canonical persisted document with deterministic object-key order. Array order (columns, patterns, recovery events) is preserved.
Sourcepub fn new(
data_source: DataSource,
column_profiles: Vec<ColumnProfile>,
execution: ExecutionMetadata,
quality: Option<QualityAssessment>,
) -> Self
pub fn new( data_source: DataSource, column_profiles: Vec<ColumnProfile>, execution: ExecutionMetadata, quality: Option<QualityAssessment>, ) -> Self
Create a new ProfileReport with auto-generated id and timestamp
Sourcepub fn with_semantic_hint_bindings(
self,
bindings: Vec<SemanticHintBinding>,
) -> Self
pub fn with_semantic_hint_bindings( self, bindings: Vec<SemanticHintBinding>, ) -> Self
Attach per-column semantic-hint binding evidence.
Sourcepub fn with_id(self, id: impl Into<String>) -> Self
pub fn with_id(self, id: impl Into<String>) -> Self
Override the auto-generated ID (useful for deterministic caching/testing)
Sourcepub fn with_timestamp(self, timestamp: impl Into<String>) -> Self
pub fn with_timestamp(self, timestamp: impl Into<String>) -> Self
Override the auto-generated timestamp
Sourcepub fn quality_score(&self) -> Option<f64>
pub fn quality_score(&self) -> Option<f64>
Calculate the overall quality score (weighted across the assessed
dimensions). Returns None if quality metrics were not computed, or
if no dimension had anything to assess (e.g. an empty dataset) —
absence of evidence is neither a perfect score nor a zero.
Sourcepub fn source_identifier(&self) -> String
pub fn source_identifier(&self) -> String
Get the data source identifier (for backwards compatibility)
Trait Implementations§
Source§impl Clone for ProfileReport
impl Clone for ProfileReport
Source§impl Debug for ProfileReport
impl Debug for ProfileReport
Source§impl<'de> Deserialize<'de> for ProfileReport
Manual deserialization so the schema_version gate runs before any other
field decodes. A derived deserializer visits fields in document order, so
an unsupported future document that also changed structure could fail with
a confusing structural error instead of the actionable version error; by
buffering the document first, the version check always wins.
impl<'de> Deserialize<'de> for ProfileReport
Manual deserialization so the schema_version gate runs before any other
field decodes. A derived deserializer visits fields in document order, so
an unsupported future document that also changed structure could fail with
a confusing structural error instead of the actionable version error; by
buffering the document first, the version check always wins.
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl JsonSchema for ProfileReport
impl JsonSchema for ProfileReport
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more