ServicesEnrichments

Inspect an Enrichment

Check which source version an Enrichment covers and whether it holds values.

Available

Before a training job reads frames/is_blurry, check that the values cover the frames version that the job reads. Each Enrichment version records the Table version that it covers and whether a refresh has computed its values, so the check reads metadata only.

Before you start

  • The Enrichment ID and the Enrichment version ID that a commit selects. Read the Resources at the commit and find the Resource with the kind enrichment. The Resource ID is the Enrichment ID, and the Resource version is the Enrichment version. See Select an exact state.
  • An access token in $SPIRAL_TOKEN, or an SDK Client.

Read the Enrichment version

read = client.enrichments.read_version(enrichment_id, version_id)
version = read.version
print(f"source Table: {read.root.source_table_id}")
print(f"covers source version: {version.source_version_id}")
print(f"materialized: {version.native_state is not None}")

The response has two parts:

FieldMeaning
root.sourceTableIdThe source Table's storage ID in the Tables service.
version.sourceVersionIdThe exact source Table version that the Enrichment covers.
version.sourceProjectCommitIdThe Project commit that selected that source version.
version.definitionThe stored expression and the type of its value.
version.nativeStateThe computed values. Present after the first successful refresh; absent means that every row reads NULL.
version.parentVersionIdThe previous Enrichment version, when one exists.

Decide whether to refresh

Compare version.sourceVersionId with the source Table version at your commit.

  • If they are equal and nativeState is present, every source row has a value.
  • If the Table is newer, rows written after the covered version read NULL, and rows with changed input columns read NULL.
  • If nativeState is absent, the Enrichment has no values yet.

The read uses metadata only. It does not scan source rows or evaluate the expression.

Found a problem? Edit this page or report an issue.

On this page