Skip to content

Instantly share code, notes, and snippets.

View yashs360's full-sized avatar

Blue yashs360

View GitHub Profile
@yashs360
yashs360 / airflow_variables.py
Last active December 21, 2017 23:50
Fetch and override Airflow rundates from the Airflow Variables
def get_overwritten_start_end_dates(default_start_date, default_end_date, config_variable_name):
"""
How to use this function?
This function expects a config defined in Airflow Variables, which can
be set from the Airflow web ui.
The function looks for START_DATE and END_DATE in the config and
returns the values. It returns the default start/end dates otherwise.
:param default_start_date:
:param default_end_date:
:param config_variable_name:
@yashs360
yashs360 / tensor_play
Last active December 19, 2017 14:15
TensorFlow visualization
import tensorflow as tf
g = tf.Graph()
with g.as_default():
a = tf.placeholder(tf.float32, name="a")
b = tf.placeholder(tf.float32, name="b")
c = a + b
from graphviz import Digraph