Skip to content

Instantly share code, notes, and snippets.

@oman36
oman36 / with_window.sql
Last active March 6, 2019 06:19
SCD Type 2
CREATE TABLE posts_stats_new
(
effective_from TIMESTAMP,
effective_to TIMESTAMP,
post_id INTEGER,
views INTEGER,
likes INTEGER,
shares INTEGER,
PRIMARY KEY (effective_from, post_id)
);
@oman36
oman36 / dag_as_mermaid.py
Created April 24, 2022 18:19
Makes a Mermaid flowchart from Apache Aiflow DAG.
from collections import (
defaultdict,
deque,
)
def dag_as_mermaid(dag) -> str:
"""
Makes a Mermaid flowchart from Apache Aiflow DAG.