Skip to content

Instantly share code, notes, and snippets.

View rahul-pande's full-sized avatar

Rahul Pande rahul-pande

View GitHub Profile
@rahul-pande
rahul-pande / pg_download_operator.py
Created September 5, 2016 07:48
Airflow Postgres Download Operator
# Airflow Operator to download results of a sql query to a file on the worker
# Pass chunksize parameter to download large tables without the
# worker running out of memory
import logging
from airflow.hooks.postgres_hook import PostgresHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults