Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.experimental.topics.record

Module Contents

RepresentationRecord

class roboto.experimental.topics.record.RepresentationRecord(/, **data)#View Source

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 Any

Attributes

RepresentationRecord.content_format

content_format str | None = None #

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

created datetime.datetime | None = None #

RepresentationRecord.created_by

created_by str #

Identity of the user who created this representation.

RepresentationRecord.field_id

field_id str | None = None #

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.fs_node_id

fs_node_id str #

Identifier of the file backing this representation.

RepresentationRecord.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

RepresentationRecord.modified

modified datetime.datetime | None = None #

RepresentationRecord.modified_by

modified_by str #

RepresentationRecord.org_id

org_id str #

Identifier of the org that owns this representation.

RepresentationRecord.representation_id

representation_id str #

Unique identifier of this representation.

RepresentationRecord.size_bytes

size_bytes int | None = None #

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

topic_part_id str #

Identifier of the topic partition this representation belongs to.

RepresentationRecord.transformations

transformations list[str] = None #

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

class roboto.experimental.topics.record.RepresentationSelector(/, **data)#View Source

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 Any

Attributes

RepresentationSelector.content_format

content_format str | None = None #

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()

matches(representation)#View Source

Return whether representation satisfies every set axis of this selector.

Parameters

representation RepresentationRecord

Return type

bool

Attributes

RepresentationSelector.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

RepresentationSelector.raw()

classmethod raw()#View Source

Select the untransformed original (a representation with no transformations).

Attributes

RepresentationSelector.storage_format

Required container (e.g. MCAP, Parquet) by scalar equality; None does not constrain it.

RepresentationSelector.transformations

transformations tuple[str, ...] | None = None #

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.

Was this page helpful?