exportrecord

package
v1.135.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package exportrecord is what one platform.export call did, as a managed script's run records it and as the script is handed it back: the output's name, format, size and where it landed, and, for an output appended to across calls (#1861), how much it holds so far.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendingValue

func AppendingValue(a Appending) starlark.Value

AppendingValue renders an Appending as the dict the script receives.

func Value

func Value(record Record) starlark.Value

Value renders one export record as the dict the script receives. Where the output went decides which part of the record is present: an asset version for the portal, an object for a bucket, the file's reference and version for the library.

Types

type Appending

type Appending struct {
	Name, Destination, Format string
	Rows, Bytes               int
	Preview                   bool
}

Appending is one append=True call's answer (#1861): the output it added to and how much that output holds so far. The output is written when the run finishes, so there is no asset or file to name yet.

type Record

type Record struct {
	Name string `json:"name"`
	// Destination is the name the script wrote, so a run that sends one result
	// to two places reads as two records rather than as a repeat.
	Destination string `json:"destination"`
	Format      string `json:"format"`
	RowCount    int    `json:"row_count"`
	// Document marks an output written verbatim from a string body, whose
	// RowCount is therefore not a fact about it: without the marker a surface
	// rendering "N rows as html" would describe a dashboard as an empty table.
	Document bool `json:"document,omitempty"`
	// Refresh marks a platform.publish_data call: the run replaced the data
	// region of an existing asset rather than writing a whole output, and
	// Bytes is the payload spliced in, not the document around it.
	Refresh bool `json:"refresh,omitempty"`
	// Bytes is the serialized length of the output in its declared format. A
	// preview serializes to measure rather than estimating, so the number is
	// the same one a real run would report for the same rows.
	Bytes int `json:"bytes"`
	// Preview is true when nothing was persisted.
	Preview      bool   `json:"preview"`
	AssetID      string `json:"asset_id,omitempty"`
	AssetVersion int    `json:"asset_version,omitempty"`
	Bucket       string `json:"bucket,omitempty"`
	Key          string `json:"key,omitempty"`
	// ResourceID, ResourceRef, ResourceURI and ResourceVersion name the managed
	// resource a library output landed in (#1663). A script reads the reference
	// and the uri off the record to cite the file it just wrote, and they are
	// the same ones the next run reports.
	ResourceID      string `json:"resource_id,omitempty"`
	ResourceRef     string `json:"reference,omitempty"`
	ResourceURI     string `json:"uri,omitempty"`
	ResourceVersion int    `json:"version,omitempty"`
	// TableChanges is what the version did to the tables registered over the
	// output's file (#1536): one sentence per table, saying it followed onto
	// the version or is pinned and now behind it. The same sentences are
	// printed into the run log, so the run's history says the table moved, or
	// did not, without the script having to print anything.
	//
	// It is a change report, not the `tables` a fetched reference carries,
	// and is named apart from them for that reason (#1666).
	TableChanges []string `json:"table_changes,omitempty"`
	// Table is the registration the export's register= argument made over
	// the written file (#1820), or the one a draft would have made.
	Table *exporttable.Table `json:"table,omitempty"`
	// References is what references= declared, or a draft would have, and [] a
	// clearing (omitzero keeps it apart from absent). UndeclaredReferences is
	// each reference a portal document names that it did not list (#1834).
	References           []string `json:"references,omitzero"`
	UndeclaredReferences []string `json:"undeclared_references,omitempty"`
	// Sheets is an xlsx output's sheets and the data rows in each (#1849).
	Sheets []tablexlsx.SheetShape `json:"sheets,omitempty"`
}

Record is what one platform.export call did, in call order on the run's Result. A record with Preview set measured the output and wrote nothing, which is what a draft run does; otherwise it names the asset version written or the object delivered.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL