Skip to content

Instantly share code, notes, and snippets.

View ryancollingwood's full-sized avatar
🙌
Grateful for the codes

Ryan Collingwood ryancollingwood

🙌
Grateful for the codes
View GitHub Profile
@ryancollingwood
ryancollingwood / sql_parse_column_query_lineage.py
Created November 2, 2023 06:43
For column that is a composite of other columns in SQL query (sub queries or CTEs), get the sql that makes up that column
from typing import Dict
import re
from dataclasses import dataclass, field
import sqlparse
@dataclass
class SQLColumnLineage():
sql: str
target_column: str
aliased_columns: Dict[str, str] = field(default_factory=lambda: dict())
@ryancollingwood
ryancollingwood / csv_to_pptx.py
Created November 11, 2024 02:53
Generate PPTX slides from CSV using a template PPTX
import sys
import re
# Dataframe
import pandas as pd
import numpy as np
# Powerpoint
from pptx import Presentation