Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.

Commit 7c7dff5

Browse files
committed
feat: more kata work
1 parent 9171e50 commit 7c7dff5

File tree

5 files changed

+565
-5
lines changed

5 files changed

+565
-5
lines changed

docs/katas/0_full_scan.ipynb

Lines changed: 462 additions & 3 deletions
Large diffs are not rendered by default.

docs/katas/9_misc.ipynb

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "f9521565",
6+
"metadata": {},
7+
"source": [
8+
"# Miscellaneous checks\n",
9+
"\n",
10+
"Answering some questions, e.g. those in https://github.com/developmentseed/labs-375-stac-geoparquet-backend/issues/71.\n",
11+
"First, how does **rustac** compare to DuckDB's Python client?"
12+
]
13+
},
14+
{
15+
"cell_type": "code",
16+
"execution_count": 6,
17+
"id": "56d3efc8",
18+
"metadata": {},
19+
"outputs": [
20+
{
21+
"name": "stdout",
22+
"output_type": "stream",
23+
"text": [
24+
"Retrieved 10000 in 1.54s (6498.29 items/s)\n",
25+
"Retrieved 10000 in 0.34s (29430.88 items/s)\n"
26+
]
27+
}
28+
],
29+
"source": [
30+
"import duckdb\n",
31+
"from rustac import DuckdbClient\n",
32+
"\n",
33+
"from labs_375 import NAIP_GEOPARQUET_URI, Timer\n",
34+
"\n",
35+
"rustac_client = DuckdbClient()\n",
36+
"rustac_client.execute(\"CREATE SECRET (TYPE S3, PROVIDER CREDENTIAL_CHAIN)\")\n",
37+
"with Timer() as timer:\n",
38+
" items = rustac_client.search(NAIP_GEOPARQUET_URI)\n",
39+
" timer.report(items)\n",
40+
"\n",
41+
"# duckdb.sql(\"CREATE SECRET (TYPE S3, PROVIDER CREDENTIAL_CHAIN)\")\n",
42+
"with Timer() as timer:\n",
43+
" items = duckdb.sql(f\"SELECT * from '{NAIP_GEOPARQUET_URI}'\")\n",
44+
" timer.report(items)"
45+
]
46+
}
47+
],
48+
"metadata": {
49+
"kernelspec": {
50+
"display_name": ".venv",
51+
"language": "python",
52+
"name": "python3"
53+
},
54+
"language_info": {
55+
"codemirror_mode": {
56+
"name": "ipython",
57+
"version": 3
58+
},
59+
"file_extension": ".py",
60+
"mimetype": "text/x-python",
61+
"name": "python",
62+
"nbconvert_exporter": "python",
63+
"pygments_lexer": "ipython3",
64+
"version": "3.12.6"
65+
}
66+
},
67+
"nbformat": 4,
68+
"nbformat_minor": 5
69+
}

infrastructure/aws/lambda/handler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@
1919
extension_directory=extension_directory,
2020
)
2121
duckdb_client.execute("CREATE SECRET (TYPE S3, PROVIDER CREDENTIAL_CHAIN)")
22+
duckdb_client.execute("SET parquet_metadata_cache = true;")
23+
duckdb_client.execute("SET force_download = true;")
2224
api = stac_fastapi.geoparquet.api.create(duckdb_client=duckdb_client)
2325
handler = Mangum(api.app, lifespan="on")

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ dev = [
3030
"ruff>=0.9.10",
3131
]
3232
katas = [
33+
"duckdb>=1.2.2",
3334
"ipykernel>=6.29.5",
34-
"matplotlib>=3.10.1",
35-
"pystac-client>=0.8.5",
35+
"matplotlib>=3.10.1",
36+
"pystac-client>=0.8.5",
37+
"rustac==0.7.0b3",
3638
]
3739

3840
[tool.mypy]

uv.lock

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)