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
redivis.datasource(source[, options])
Return a Datasource within the default workflow, or the workflow provided.
Workflow.datasource(source)
Return a Datasource within a specific workflow.
Workflow.listDatasources([maxResults])
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
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
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.
Return the source Workflow.
Datasource.update(options)
Change the datasource's source, version, sample, or table mappings.
Was this helpful?

