This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version = 1 | |
requires-python = ">=3.12" | |
resolution-markers = [ | |
"python_full_version < '3.13'", | |
"python_full_version >= '3.13'", | |
] | |
[[package]] | |
name = "annotated-types" | |
version = "0.7.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_pandas_from_sql(sql: str) -> pd.DataFrame: | |
start = time.start() | |
with st.expander("Show the SQL query that generated this data"): | |
st.code(sql, language="sql") | |
@st.cache_data(ttl=TTL) | |
def get_df(sql): | |
dataframe = session.sql(sql).to_pandas() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First pip install 'shillelagh[all]' | |
from shillelagh.backends.apsw.db import connect | |
connection = connect(":memory:") | |
cursor = connection.cursor() | |
query = """ | |
SELECT country, SUM(cnt) | |
FROM "https://docs.google.com/spreadsheets/d/1_rN3lm0R_bU3NemO0s9pbFkY5LQPcuy1pscv8ZXPtg8/edit#gid=0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone --bare https://github.com/blackary/dotfiles2 $HOME/.cfg | |
function config { | |
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@ | |
} | |
mkdir -p .config-backup | |
config checkout | |
if [ $? = 0 ]; then | |
echo "Checked out config."; | |
else | |
echo "Backing up pre-existing dot files."; |