Skip to content

Instantly share code, notes, and snippets.

View TimmyCarbone's full-sized avatar

Timothy Carbone TimmyCarbone

View GitHub Profile
@TimmyCarbone
TimmyCarbone / dbt_dag.py
Last active January 28, 2021 09:15
Example of dbt scheduling with Airflow
# How to schedule dbt runs with Airflow using gocardless/airflow-dbt
# Folder structure is as such:
#
# /app
# /airflow
# /dags
# /dbt_dag.py
# /dbt
# /config
@TimmyCarbone
TimmyCarbone / distribute-streams.js
Last active September 11, 2019 04:13
Distribute rows from readable stream to multiple streams depending on the row content
const { PassThrough } = require('stream');
// FUNCTIONS
// --------
// Function: For each partition, we create an object containing a stream and
// limits for that partition.
const createBranchingStreams = (partitions) => {
let streams = partitions.map((p, i) => ({
min: p.min,