Skip to content

Scratchpad Manager

Classes:

PipelineTestResponse

Bases: BaseModel

Pipeline test deploy response dto.

Attributes:

ScratchpadClient

Bases: ApiClient

Scratchpad Client.

Functions:

  • display – Call display endpoint.
  • pipeline_status – Get the status of the current test pipeline and its captured traces.
  • pipeline_trace – Get the captured traces of the current test pipeline.
  • roll_unit – Roll a unit from its current term.
  • teardown_pipeline – Tear down the current test pipeline.
  • test_pipeline – Run a test deploy of a pipeline in the scratchpad.
  • trigger_read – Trigger a read on the readers of the test pipeline.
  • trigger_write – Trigger a write on the writers of the test pipeline.
  • unit_term – Get the status of one term of a unit.
  • unit_terms – Get a unit's active terms.
  • units – List the units (disconnected data flows) in the test pipeline.
  • upload – Upload to the test pipeline's fromUpload node.

display

display(**kwargs)

Call display endpoint.

pipeline_status

pipeline_status()

Get the status of the current test pipeline and its captured traces.

pipeline_trace

pipeline_trace()

Get the captured traces of the current test pipeline.

roll_unit

roll_unit(unit_id, from_term_id, force=False)

Roll a unit from its current term.

Parameters:

  • unit_id (str) – Unit ID.
  • from_term_id (int) – The unit's current term ID.
  • force (bool) – Roll even if the unit's previous term is still finishing, abandoning it and discarding its operators' outstanding work. Defaults to False.

teardown_pipeline

teardown_pipeline()

Tear down the current test pipeline.

test_pipeline

test_pipeline(pipeline, packages=None)

Run a test deploy of a pipeline in the scratchpad.

Only one test pipeline can run at a time.

Parameters:

  • pipeline (Dict[str, Any]) – Pipeline graph and settings.
  • packages (Optional[List[str]]) – Packages to install before running the pipeline, e.g. ["package", "package2==1.1.1"]. Defaults to None.

trigger_read

trigger_read(op_ids=None, op_args=None)

Trigger a read on the readers of the test pipeline.

Parameters:

  • op_ids (Optional[List[str]]) – IDs of specific reader operators to trigger. Defaults to every reader configured for triggering.
  • op_args (Optional[Dict[str, Dict[str, Any]]]) – Arguments for the triggered operators, keyed by operator ID. Defaults to None.

trigger_write

trigger_write(op_ids=None, op_args=None)

Trigger a write on the writers of the test pipeline.

Parameters:

  • op_ids (Optional[List[str]]) – IDs of specific writer operators to trigger. Defaults to every writer configured for triggering.
  • op_args (Optional[Dict[str, Dict[str, Any]]]) – Arguments for the triggered operators, keyed by operator ID. Defaults to None.

unit_term

unit_term(unit_id, term_id)

Get the status of one term of a unit.

Poll this to wait for a rolled term to drain: state is finished once the term has finished.

Parameters:

  • unit_id (str) – Unit ID.
  • term_id (int) – Term ID.

unit_terms

unit_terms(unit_id)

Get a unit's active terms.

Parameters:

  • unit_id (str) – Unit ID.

units

units()

List the units (disconnected data flows) in the test pipeline.

upload

upload(name, data, finish=False, table=None)

Upload to the test pipeline's fromUpload node.

Parameters:

  • name (str) – Name of upload.
  • data (Dict | bytes | str) – Data payload. It can be a python dictionary.
  • finish (bool) – Finish the operator. Defaults to False.
  • table (Optional[str]) – Table name, passed to operator as metadata. Defaults to None.

ScratchpadPipelineStatus

Bases: BaseModel

Status of the scratchpad test pipeline.

Attributes:

ScratchpadPipelineTrace

Bases: BaseModel

Captured traces of the scratchpad test pipeline.

Attributes:

  • status (Optional[str]) – Availability of the traces, e.g. AVAILABLE.
  • trace (Value) – Map of operator names to the data captured at that operator.

ScratchpadTeardownResponse

Bases: BaseModel

Scratchpad pipeline teardown response dto.

Attributes:

ScratchpadTriggerResponse

Bases: BaseModel

Scratchpad pipeline trigger read/write response dto.

Attributes:

ScratchpadUploadResponse

Bases: BaseModel

Scratchpad pipeline upload response dto.

Attributes:

Back to top