Giter Club home page Giter Club logo

dagster-pipes-r-demo's Introduction

Showcase dagster-pipes usage from R

This project demonstrates the usage of dagster-pipes from an R runtime environment. It supports handling of context extracts, as well as logging events back to Dagster. It showcases a simple pipeline that loads in NYC vehicle collision data and generates a plot of annual collision per borough.

Demonstration

Context Parameters

Extras can be specified as a parameter to the pipes_subprocess_client run method.

    return pipes_subprocess_client.run(
        command=cmd,
        context=context,
        extras={
            "vehicle_collisions_url": "https://data.cityofnewyork.us/api/views/h9gi-nx95/rows.csv",
            "vehicle_collisions_cache_path": "data/nyc-collisions.csv",
            "plot_output_path": "nyc-vehicle-collisions-by-borough.png",
        },
    ).get_materialize_result()

They can then be accessed from the context in R like so:

context <- load_context(params$context_params)

Event Logging

A logger can be used to send events back to the Dagster instance.

logger <- PipesLogger$new(params)

logger$open()

logger$info(sprintf("saving plot to: %s", plot_output_path))
image

Usage

pip install -e ".[dev]"

Then, start the Dagster UI web server:

dagster dev

Open http://localhost:3000 with your browser to see the project.

Extra

This is the resulting plot that is generated from the pipeline.

image

dagster-pipes-r-demo's People

Contributors

cmpadden avatar

Stargazers

Isabella Velásquez avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.