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

Workflow

class Workflow

Workflows on Redivis are where analytical pipelines are built and executed. All workflows are owned by a user, and are made up of datasources, transforms, notebooks, and tables.

Constructors

Method
Description

redivis.current_workflow()

Get the current default workflow. Typically called within notebooks.

Organization.list_workflows([max_results])

List all workflows owned by an organization.

Organization.workflow(name)

Construct a new workflow instance that references a workflow owned by an organization.

User.list_workflows([max_results])

List all workflows owned by a user.

User.workflow(name)

Construct a new workflow instance that references a workflow owned by a user.

Examples

workflow = redivis.user("imathews").workflow("example_workflow_climate_analysis")
tables = workflow.list_tables()

for table in tables:
    # Properties will be populated with the table.list resource representation
    print(table.properties) 
    
    table.get()
    # Properties will now be populated with the table.get resource representation
    print(table.properties) 

workflow.table("join_lat_lon_output").exists() # -> TRUE
workflow = redivis.user("imathews").workflow("example_workflow_climate_analysis")

query = workflow.query("""
    SELECT
        id,
        EXTRACT(YEAR FROM date) AS year,
        SUM(value) AS annual_precip
    FROM daily_observations
    WHERE (element = 'PRCP')
    GROUP BY id, year
""")

query.to_pandas_dataframe()
# 	id	        year	    annual_precip
# 0	CA0023026HN	2003	    2925.0
# ...

Attributes

properties

A dict containing the API resource representation of the workflow. This will be fully populated after calling Workflow.get(), and partially populated for workflows created via User.list_workflows. Otherwise will be None.

qualified_reference

The fully qualified reference for the workflow, which can be used in SQL queries or the REST API. E.g., imathews.example_workflow_climate_analysis:x7kh

scoped_reference

The canonical reference for the workflow, without the username qualifier. E.g.,: example_workflow_climate_analysis:x7kh

user

A reference to the User instance that constructed this workflow.

organization

A reference to the Organization instance that constructed this workflow.

Methods

Workflow.datasource()

Create a reference to a datasource within the workflow.

Workflow.exists()

Check whether the workflow exists.

Workflow.get()

Get the workflow, populating the properties attribute on the current instance.

Workflow.list_datasources([max_results])

List all datasources in the workflow.

Workflow.list_notebooks([max_results])

List all notebooks in the workflow.

Workflow.list_parameters([max_results])

List all parameters in the workflow

Workflow.list_tables([max_results])

List all tables in the workflow.

Workflow.list_transforms([max_results])

List all transforms in the workflow.

Workflow.notebook(name)

Create a reference to a specific notebook within the workflow.

Workflow.parameter(name)

Create a reference to a specific parameter within the workflow.

Workflow.query(query_string)

Create a query scoped to the workflow.

Workflow.table(name)

Create a reference to a specific table within the workflow.

Workflow.transform(name)

Create a reference to a specific transform within the workflow.

Workflow.update_variables(variables)

Batch update variable metadata across tables in a workflow.

Last updated

Was this helpful?