Datasource

class Datasource

An interface for working with workflow datasources on Redivis.

Constructors

Create a reference to a datsource. Can only be called if a default workflow is set.

Create a reference to a Datasource within a specific workflow.

Returns a list of Datasources within a workflow

Examples

username = "imathews"
workflow_name = "example_workflow_climate_analysis:x7kh"
dataset_name = "ghcn_daily_weather_data"

workflow = redivis.workflow(f"{username}.{workflow_name}")
datasource = workflow.datasource(dataset_name)

datasource.update(version="v2.0")

Attributes

workflow

A reference to the Workflow instance that this datasource belongs to.

properties

A dict containing the API resource representation of the datasource. This will only be populated after certain methods are called, particularly the get method, and will otherwise be None.

Methods

Fetches the datasource, after which datasource.properties will contain a dict with entries corresponding to the properties on the datasource resource definition. Will raise an error if the datasource does not exist.

Check whether the datasource exists.

Update the datasource to reference a new dataset, workflow, or version thereof.

Last updated

Was this helpful?