Skip to content

Instantly share code, notes, and snippets.

@thomascamminady
thomascamminady / script.py
Created April 28, 2025 09:34
uv script template
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "fire",
# ]
# ///
# pyright: reportMissingModuleSource=false
# pyright: reportMissingImports=false
@thomascamminady
thomascamminady / run_query_against_redshift.py
Created February 11, 2025 11:59
Run Metabase queries in the command line
# /// script
# dependencies = [
# "fire",
# "polars",
# "rich",
# "redshift_connector",
# ]
# ///
import json
@thomascamminady
thomascamminady / drop_columns_that_are_all_null.py
Created September 20, 2023 07:40
Polars drop columns that are all null
import polars as pl
def drop_columns_that_are_all_null(_df: pl.DataFrame) -> pl.DataFrame:
return _df[[s.name for s in _df if not (s.null_count() == _df.height)]]