Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Datasource

class Datasource

A datasource is a dataset or workflow that's been added to a workflow, making its tables available within that workflow. Various methods allow you to add datasources to a workflow, to change their source, version, or sample, and to remove them.

Constructors

Method
Description

redivis.datasource(source[, options])

Return a Datasource within the default workflow, or the workflow provided.

Return a Datasource within a specific workflow.

List the Datasources of a workflow.

source is the source dataset or workflow (a Dataset or Workflow instance), or its qualified reference, e.g. demo.iris_species.

Examples

const workflow = redivis.workflow('jane.my_workflow');

// Add a dataset to the workflow
const datasource = await workflow.datasource('demo.iris_species').create();

// Switch to the dataset's sample, or pin a specific version
await datasource.update({ sample: true });
await datasource.update({ sample: false, version: 'v1_0' });

// Replace the source with a different dataset, mapping tables that were renamed
await datasource.update({
  sourceDataset: 'demo.iris_species_v2',
  mappedTables: [['iris', 'iris_flowers']],
});

const dataset = await datasource.sourceDataset(); // -> Returns a Dataset

// Remove the datasource, along with the transforms and notebooks that depend on it
await datasource.delete();

Attributes

Name
Description

workflow

The Workflow that the datasource belongs to.

sourceReference

The qualified reference of the datasource's source dataset or workflow.

properties

An object containing the API resource representation of the datasource. This will only be populated after certain methods are called, particularly the get method.

Methods

Method
Description

Add the source to the workflow.

Remove the datasource from the workflow, along with the transforms and notebooks that depend on it.

Check whether the datasource exists.

Fetch the datasource's metadata, populating datasource.properties.

Return the source Dataset.

Change the datasource's source, version, sample, or table mappings.

Was this helpful?