roboto.experimental.topics.record
Module Contents
RepresentationRecord
Bases: pydantic.BaseModel
One stored variant of a topic partition’s data, optionally narrowed to a subset of its fields.
A representation pairs a stored file with the data of a single topic partition. field_id narrows it to one field and the fields nested under it; None covers every field in the partition.
The same partition can have several representations that differ in storage_format, content_format, and transformations. A consumer picks the one whose attributes suit it: a viewer of image data, for example, may prefer a JPEG- or PNG-encoded variant over the untransformed original.
Parameters
data AnyAttributes
RepresentationRecord.content_format
The format of the data inside the stored file. For image data, this may be the image encoding (e.g. "jpeg", "png") on a transformed variant. None when unspecified.
RepresentationRecord.created
RepresentationRecord.created_by
Identity of the user who created this representation.
RepresentationRecord.field_id
The field this representation is narrowed to, covering that field and the fields nested under it. None when the representation covers every field in the partition.
RepresentationRecord.model_config
model_config #Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
RepresentationRecord.modified
RepresentationRecord.modified_by
RepresentationRecord.representation_id
Unique identifier of this representation.
RepresentationRecord.size_bytes
Size in bytes of the file backing this representation, when known; None when the size is unavailable.
Populated on read-plan resolution so the plan can carry the backing file’s size onto its object refs. Write paths that upsert a representation leave it None.
RepresentationRecord.storage_format
Container the representation data is stored in (e.g. MCAP, Parquet).
RepresentationRecord.topic_part_id
Identifier of the topic partition this representation belongs to.
RepresentationRecord.transformations
The transformations applied to the source data to produce this variant, in the order applied. Empty on the untransformed original.
Each entry is a "<kind>:<param>" string whose <kind> is a TransformationKind member, e.g. ["downsample:0.5", "encode:jpeg"].
RepresentationSelector
Bases: pydantic.BaseModel
Selects which stored variant of a field to read when several are available.
A selector has three optional criteria — storage_format, content_format, and transformations — one for each attribute on which stored variants of the same field can differ (see RepresentationRecord). A criterion that is set is a requirement a variant must meet to be selected; a criterion left None places no requirement, and any value is acceptable.
A selector never falls back to a variant other than the one it describes. If any criterion is set and no stored variant of a requested field meets every requirement — whether the variants that exist all fall short, or the field has no stored variant at all — the read fails with an error rather than quietly leave out the field. Only under a selector with no criteria set is a field with no stored variant simply absent from the result; such a selector requires nothing, so nothing requested is missing.
Successor to roboto.domain.topics.RepresentationSelector, used by get_data().
Parameters
data AnyAttributes
RepresentationSelector.content_format
Required content encoding (e.g. "jpeg") by scalar equality; None does not constrain it.
There is no legacy carve-out: a representation whose content_format is None does not satisfy an explicit request.
RepresentationSelector.matches()
Return whether representation satisfies every set axis of this selector.
Parameters
representation RepresentationRecordReturn type
Attributes
RepresentationSelector.model_config
model_config #Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
RepresentationSelector.raw()
Select the untransformed original (a representation with no transformations).
Return type
Attributes
RepresentationSelector.storage_format
Required container (e.g. MCAP, Parquet) by scalar equality; None does not constrain it.
RepresentationSelector.transformations
Required transformations; None does not constrain, () requires the untransformed original.
A non-empty tuple is all-of: every token must be satisfied by some descriptor on the representation, which may carry additional transformations. A token is either a bare kind (e.g. "downsample"), satisfied by any descriptor whose kind prefix equals it, or a full "<kind>:<param>" descriptor (e.g. "encode:jpeg"), satisfied only by an exact match. The grammar is open string matching; the recognized vocabulary (TransformationKind) is enforced by the service at the request boundary, which rejects a token naming an unrecognized kind.