This file contains hidden or 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
import json | |
examples = [ | |
{ | |
"id": "Q1", | |
"aliases": ["Universe", "Cosmos"], # list of strings | |
"labels": { # categorical map | |
"en": "universe", | |
"fr": "univers", | |
"de": "Universum" |
This file contains hidden or 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
import polars as pl | |
import fastavro | |
from pathlib import Path | |
# Define an Avro schema with both record (struct) and map | |
schema = { | |
"type": "record", | |
"name": "Inventory", | |
"fields": [ | |
{"name": "id", "type": "int"}, |
This file contains hidden or 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
#!/usr/bin/env rust-script | |
//! ```cargo | |
//! [dependencies] | |
//! diesel = { version = "2.2", features = ["sqlite"] } | |
//! diesel-dynamic-schema = "0.2" | |
//! rusqlite = "0.31" | |
//! serde = { version = "1", features = ["derive"] } | |
//! serde_json = "1" | |
//! ``` |
This file contains hidden or 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
import duckdb | |
import polars as pl | |
from typing import Iterator, Optional | |
from polars.io.plugins import register_io_source | |
from duckdb import SQLExpression | |
import json | |
from decimal import Decimal | |
import datetime |
This file contains hidden or 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
# Delete all the unwanted defaults | |
gh label delete bug --yes | |
gh label delete documentation --yes | |
gh label delete duplicate --yes | |
gh label delete enhancement --yes | |
gh label delete "good first issue" --yes | |
gh label delete "help wanted" --yes | |
gh label delete invalid --yes | |
gh label delete question --yes | |
gh label delete wontfix --yes |
This file contains hidden or 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
#!/usr/bin/env rust-script | |
//! ```cargo | |
//! [dependencies] | |
//! ordermap = "0.5" | |
//! serde = { version = "1", features = ["derive"] } | |
//! serde_json = { version = "1", features = ["preserve_order"] } | |
//! anyhow = "1" | |
//! ``` | |
use anyhow::Result; |
This file contains hidden or 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
If you debug the Python stack trace when passing in a simple 2 col DF | |
```py | |
(polars-genson-py) louis 🌟 ~/dev/polars-genson/polars-genson-py $ qp schema_test.py | |
[1] > /home/louis/dev/polars-genson/polars-genson-py/python/polars_genson/__init__.py(45)schema_to_json() | |
-> breakpoint() | |
(Pdb++) n | |
[1] > /home/louis/dev/polars-genson/polars-genson-py/python/polars_genson/__init__.py(46)schema_to_json() | |
-> return _rust_schema_to_json(df) | |
(Pdb++) s |
This file contains hidden or 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 status report task | |
gnews: | |
#!/usr/bin/env python3 | |
from subprocess import check_output | |
gnew = check_output(["git", "status", "--porcelain"], text=True).splitlines() | |
groups = { | |
"M": "Changed", | |
"A": "Added", |
This file contains hidden or 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 status report task | |
gnews: | |
#!/usr/bin/env python3 | |
from subprocess import check_output | |
gnew = check_output(["git", "status", "--porcelain"], text=True).splitlines() | |
groups = { | |
"M": "Changed", | |
"A": "Added", |
This file contains hidden or 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
main: | |
just trap-demo | |
just do-more-things | |
echo ">>> Finished" | |
trap-demo: | |
#!/usr/bin/env bash | |
set -e | |
echo ">>> Task starting" |
NewerOlder