Skip to main content

ProfileReport

Struct ProfileReport 

Source
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: u32

Version 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: String

Unique identifier for this report (UUID v4)

§timestamp: String

Timestamp when the report was generated (ISO 8601 / RFC 3339)

§data_source: DataSource

Data source metadata (file, query, etc.)

§column_profiles: Vec<ColumnProfile>

Column-level profiling results

§execution: ExecutionMetadata

Execution metadata (timing, rows processed, truncation info, etc.)

§quality: Option<QualityAssessment>

Data quality assessment (optional — partial analysis may skip quality)

§quality_status: QualityAnalysisStatus

What 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

Source

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

Source

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.

Source

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

Source

pub fn with_semantic_hint_bindings( self, bindings: Vec<SemanticHintBinding>, ) -> Self

Attach per-column semantic-hint binding evidence.

Source

pub fn with_id(self, id: impl Into<String>) -> Self

Override the auto-generated ID (useful for deterministic caching/testing)

Source

pub fn with_timestamp(self, timestamp: impl Into<String>) -> Self

Override the auto-generated timestamp

Source

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.

Source

pub fn source_identifier(&self) -> String

Get the data source identifier (for backwards compatibility)

Trait Implementations§

Source§

impl Clone for ProfileReport

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProfileReport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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.

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for ProfileReport

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for ProfileReport

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V