Skip to content

ump_spec.models.dataset

module ump-spec

provisional (not yet in the spec) G-DATA-06 is in the gate registry but not yet in the specification’s gate catalogue, so it is not normative.

Datasets, deliveries and transform steps (spec §6).

class

class Delivery(StrictModel)

G-DATA-01 intake record.

Fields

NameTypeDefaultDescription
sourcestr | NoneNone
contactstr | NoneNone
pull_datedate | NoneNone
covered_rangedict[str, date] | NoneNone
file_fingerprintstr | NoneNonesha256:<hex> of the raw file (spec §6); a bare hex digest is read and rewritten with the prefix.
column_mappingsdict[str, str]dict()column -> registry id
known_issueslist[str]list()
registeredboolTrue

Source: packages/ump-spec/src/ump_spec/models/dataset.py, line 59

class

class DimSpec(StrictModel)

Fields

NameTypeDefaultDescription
kindLiteral['categorical', 'time', 'integer', 'float', 'index']'categorical'
policyLiteral['fixed', 'extend', 'new_levels']'fixed'
freqstr | NoneNone

Source: packages/ump-spec/src/ump_spec/models/dataset.py, line 78

class

class VarSpec(StrictModel)

Fields

NameTypeDefaultDescription
dimslist[str]list()
dtypestr'float64'
roleLiteral['target', 'covariate', 'media', 'spend', 'control', 'index', 'mask', 'constant', 'weight', 'exposure']'covariate'
unitsstr | NoneNone
missingLiteral['forbid', 'allow', 'mask']'forbid'

Source: packages/ump-spec/src/ump_spec/models/dataset.py, line 84

class

class LicenceLimits(StrictModel)

Vendor or client licence limits checked before export (spec §20).

Fields

NameTypeDefaultDescription
textstr | NoneNone
idslist[str]list()

Source: packages/ump-spec/src/ump_spec/models/dataset.py, line 117

class

class AccessPolicy(StrictModel)

Access rules on a data connection, copied onto each connected dataset (POC DATA-CATALOGUE §2).

Fields

NameTypeDefaultDescription
copy_policyCopyPolicy'transient_only'
retention_daysint | NoneNoneFor cached copies; defaults to the client contract’s retention_days (rules.effective_access).
min_segment_sizeint | NoneNoneFor aggregates_only; defaults to the contract’s G-PRIV-01 floor.
allowed_useslist[DataUse]lambda: list(DEFAULT_USES)()
licence_limitsLicenceLimits | NoneNone

Source: packages/ump-spec/src/ump_spec/models/dataset.py, line 124

class

class FetchRecord(StrictModel)

What a run saw when it read a dataset (POST /v1/datasets/{id}:materialize). Run records and model lineage keep this record, never the rows of a transient_only dataset.

Fields

NameTypeDefaultDescription
dataset_idstr
dataset_versionint | NoneNone
storageDatasetStorage'stored'
connection_idstr | NoneNone
fingerprint_seenstr | NoneNonesha256 hex of what came back this time.
fingerprint_registeredstr | NoneNoneThe dataset’s sha256 at registration.
driftboolFalse
rowsint | NoneNone
fetched_atdatetime | NoneNone
copy_policyCopyPolicy'allowed'
reachableboolTrue
sourceLiteral['live', 'stored', 'cached_copy', 'none']'live'Where the rows came from: a live connector fetch, the stored file, a cached copy used because the connection was unreachable (CACHED_COPY_USED), or nothing (CONNECTION_UNAVAILABLE, step not available).
connector_stubboolFalse
useDataUse | NoneNone
purpose_artifact_idstr | NoneNone

Source: packages/ump-spec/src/ump_spec/models/dataset.py, line 136

class

class Dataset(ArtifactDoc)

Fields

NameTypeDefaultDescription
refstrdataset://{scope}/{name}@sha256:{hash}
scopestr
namestr
sha256str
client_idstr | NoneNone
layoutLiteral['dense', 'long']'long'
dimsdict[str, DimSpec]dict()
varsdict[str, VarSpec]dict()
extraction_ratingExtractionRating'exact'
tool_error_ratefloat | NoneNone
audit_levelLiteral[1, 2, 3, 4]2
deliveryDeliveryDelivery()
n_rowsint | NoneNone
columnslist[str]list()
blob_uristr | NoneNoneContent-addressed blob location (POC: var/blobs).
totals_checkdict[str, Any] | NoneNoneG-DATA-02 extracted vs printed.
storageDatasetStorage'stored'stored: a file in the blob store; connected: read through a data_connection when used, rows not kept.
connection_idstr | NoneNonedata_connection artifact id (connected only).
request_specdict[str, Any] | NoneNoneQuery or request spec for the connector (connected only). Never holds secrets.
materializationMaterialization'none'cached: a copy is kept in the blob store, only when access.copy_policy is allowed.
accessAccessPolicy | NoneNoneCopied from the connection; null on a stored dataset means the client contract’s terms apply.
fingerprint_basisFingerprintBasis | NoneNoneFilled from storage when absent: file_bytes (stored) or canonical_rows (connected).
recipeRecipeRef | NoneNoneHow this dataset was made: a pointer to the transform recipe uploaded with it (G-DATA-06). Null for raw deliveries and datasets uploaded without one.
rolestr | NoneNoneRole of the dataset, e.g. raw_delivery or derived. Written by data (service.py), onboarding and experiments.
source_formatstr | NoneNoneSource file format, e.g. csv. Written by data (service.py), onboarding and experiments.
descriptionstr | NoneNonePlain description. Written by data (service.py), onboarding and experiments.
connectorstr | NoneNoneConnector kind of a connected dataset. Written by data (service.py), onboarding and experiments.
mappingdict[str, Any] | NoneNoneColumn mapping onto canonical names. Written by data (service.py), onboarding and experiments.
mapping_stalestr | NoneNoneWhy the stored mapping no longer fits the source. Written by data (service.py), onboarding and experiments.
canonical_columnslist[str] | NoneNoneCanonical column names after mapping. Written by data (service.py), onboarding and experiments.
fit_hintsdict[str, Any] | NoneNoneHints for a first fit: date and KPI columns, channels, controls. Written by data (service.py), onboarding and experiments.
annual_spenddict[str, Any] | NoneNoneAnnual spend per channel. Written by data (service.py), onboarding and experiments.
extractiondict[str, Any] | NoneNoneHow the data was extracted: method, tool, checks. Written by data (service.py), onboarding and experiments.
tie_outdict[str, Any] | NoneNoneTie-out against printed totals (tolerance proposed). Written by data (service.py), onboarding and experiments.
recipe_checkdict[str, Any] | NoneNoneG-DATA-06 recipe check result. Written by data (service.py), onboarding and experiments.
previous_fingerprintstr | NoneNoneFingerprint before the latest refresh. Written by data (service.py), onboarding and experiments.
refreshed_atstr | NoneNoneLast refresh, RFC 3339. Written by data (service.py), onboarding and experiments.
truthdict[str, Any] | NoneNoneKnown truth of a synthetic panel (synthetic data only). Written by data (service.py), onboarding and experiments.
noteslist[str] | NoneNoneNote codes. Written by data (service.py), onboarding and experiments.

Source: packages/ump-spec/src/ump_spec/models/dataset.py, line 159

class

class TransformStep(ArtifactDoc)

Fields

NameTypeDefaultDescription
typeTransformType
inputslist[str]list()
outputslist[str]list()
settingsdict[str, Any]dict()
learned_statedict[str, Any] | NoneNone
whostr | NoneNone
whendatetime | NoneNone
timingLiteral['before_results', 'after_results']'before_results'
reasonstr | NoneNone
split_assumptionstr | NoneNone

Source: packages/ump-spec/src/ump_spec/models/dataset.py, line 294

function

def make_dataset_ref(scope: str, name: str, sha256_hex: str) -> str

dataset://{scope}/{name}@sha256:{hash}.

Source: packages/ump-spec/src/ump_spec/models/dataset.py, line 21

function

def parse_dataset_ref(ref: str) -> dict[str, str]

Source: packages/ump-spec/src/ump_spec/models/dataset.py, line 29

function

def worst_extraction(ratings: list[str]) -> str | None

Source: packages/ump-spec/src/ump_spec/models/dataset.py, line 36

function

def digest_hex(value: str | None) -> str | None

The bare lowercase hex of a sha256:<hex> or bare-hex digest (compare digests with this on both sides); anything else is returned unchanged.

Source: packages/ump-spec/src/ump_spec/models/dataset.py, line 44

function

def sha256_digest(value: str | None) -> str | None

Spec §6: a digest is written sha256:<lowercase hex>; a bare hex digest gains the prefix.

Source: packages/ump-spec/src/ump_spec/models/dataset.py, line 53

NameTypeValueDescription
ExtractionRatingLiteral['exact', 'parsed', 'read', 'retyped']
EXTRACTION_ORDERtuple[str, ...]('exact', 'parsed', 'read', 'retyped')Best to worst; a model shows the lowest rating among its inputs.
CopyPolicyLiteral['allowed', 'transient_only', 'aggregates_only']allowed: may be cached to the blob store. transient_only: rows live in memory for one run (the default for connections). aggregates_only: clean room, only aggregates above the minimum segment size come out (G-PRIV-01..03 run on every fetch).
COPY_POLICIEStuple[str, ...]('allowed', 'transient_only', 'aggregates_only')
DataUseLiteral['fit', 'score', 'side_modelling', 'benchmark', 'transform']What a client lets UMP do with the data. Benchmark pooling is off unless listed and the licence allows it.
DATA_USEStuple[str, ...]('fit', 'score', 'side_modelling', 'benchmark', 'transform')
DEFAULT_USEStuple[DataUse, ...]('fit', 'score', 'side_modelling')Granted when a policy does not list uses; benchmark pooling and transform must be listed explicitly.
DatasetStorageLiteral['stored', 'connected']
MaterializationLiteral['none', 'cached']
FingerprintBasisLiteral['file_bytes', 'canonical_rows']What sha256 hashes: the raw file’s bytes (stored) or the canonical JSON of the query result’s rows (connected; rules.canonical_rows_fingerprint).
TransformTypeLiteral['filter', 'aggregate', 'join', 'convert_currency', 'map_names', 'spli...