UNPKG

open-lineage-client

Version:

TypeScript/JavaScript client for creating and sending OpenLineage standard events.

58 lines 1.83 kB
import { BaseFacet } from './BaseFacet.js'; /** * Represents the facets of an input dataset. */ export class InputDatasetFacets { constructor(dataQualityMetrics = null) { this.dataQualityMetrics = dataQualityMetrics; } } /** * Represents data quality metrics for an input dataset. */ export class DataQualityMetrics extends BaseFacet { constructor(producer, schemaURL, columnMetrics = {}, rowCount = null, bytes = null, fileCount = null) { super(producer, schemaURL); this.columnMetrics = columnMetrics; this.rowCount = rowCount; this.bytes = bytes; this.fileCount = fileCount; } /** * Adds column metrics to the dataset. * @param key - The key for the column metrics. * @param columnMetrics - The column metrics to add. */ addColumnMetrics(key, columnMetrics) { this.columnMetrics = { ...this.columnMetrics, [key]: columnMetrics }; } /** * Returns the schema URL for the data quality metrics. */ getSchema() { return 'https://openlineage.io/spec/facets/1-0-2/DataQualityMetricsInputDatasetFacet.json'; } } /** * Represents metrics for a specific column. */ export class ColumnMetrics { constructor(nullCount, distinctCount, sum, count, min, max, quantiles) { this.nullCount = nullCount; this.distinctCount = distinctCount; this.sum = sum; this.count = count; this.min = min; this.max = max; this.quantiles = quantiles; } /** * Adds a quantile to the column metrics. * @param key - The key for the quantile. * @param value - The value of the quantile. */ addQuantile(key, value) { this.quantiles = { ...this.quantiles, [key]: value }; } } //# sourceMappingURL=InputDatasetFacets.js.map