Skip to content

Commit 3c5c816

Browse files
authored
Merge pull request #16 from opensource-observer/carl/ddp-notebook-freshness-doc-refs
docs(notebooks): refresh data-source references and hide_code compliance
2 parents 9d2c736 + edf271f commit 3c5c816

7 files changed

Lines changed: 24 additions & 19 deletions

File tree

notebooks/claude.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,22 @@ def _(mo, pyoso_db_conn):
274274

275275
### Developer models
276276
- `oso.int_ddp__developers` — Unified developer list (ODD + GHA), keyed by `user_id`
277-
- `oso.stg_opendevdata__developers` — ODD developers with GraphQL IDs
277+
- `oso.stg_opendevdata__canonical_developers` — ODD canonical developers, keyed to GitHub GraphQL user IDs (`primary_github_user_id`)
278278

279279
### Commit models
280280
- `oso.int_ddp__commits_unified` — Combined ODD + GHA commits (not deduped)
281281
- `oso.int_ddp__commits_deduped` — Deduplicated unified commits
282282
- `oso.stg_opendevdata__commits` — Raw ODD commits with identity resolution
283283

284-
### GitHub Archive (event models)
284+
### GitHub events — unified models (current canonical)
285+
- `oso.int_events__github_unified` — Standardized GitHub events, one row per event. Keyed by OSO artifact IDs (`from_artifact_id` / `to_artifact_id`); original GitHub IDs live in the `*_source_id` columns. Canonical entrypoint used by `events.py`.
286+
- `oso.int_events_daily__github_unified` — Daily aggregation (`bucket_day` × artifact × `event_type`, with `amount`)
287+
288+
### GitHub Archive — legacy DDP pipeline models
289+
Still queried by `repositories.py`, `timeseries-metrics.py`, `developers.py`, `github-archive.py`. Keyed by integer `actor_id` / `repo_id` (not artifact IDs).
285290
- `oso.stg_github__events` — Raw events with nested fields
286-
- `oso.int_gharchive__github_events` — Standardized events (canonical entrypoint)
287-
- `oso.int_ddp_github_events` — Curated subset of event types
291+
- `oso.int_gharchive__github_events` — Standardized events at PushEvent grain
292+
- `oso.int_ddp_github_events` — Curated subset of event types (`PushEvent`, `WatchEvent`)
288293
- `oso.int_ddp_github_events_daily` — Daily aggregation with normalized types
289294
- `oso.int_gharchive__developer_activities` — Daily rollup for MAD metrics
290295

@@ -304,7 +309,7 @@ def _(mo, pyoso_db_conn):
304309

305310
When writing or documenting model notebooks, be explicit about:
306311

307-
- **Freshness**: GitHub Archive is ~3 days behind real-time
312+
- **Freshness**: GitHub Archive data typically lags real-time by ~1–2 weeks; ODD models (`eco_mads`, `repo_developer_28d_activities`) lag by ~2–3 weeks. Check `MAX(bucket_day)` / `MAX(day)` if exact currency matters.
308313
- **Completeness**: Public GitHub timeline only — no private repos, no deleted events
309314
- **Identity**: `actor_id` is a GitHub REST ID; `canonical_developer_id` is from Open Dev Data — don't conflate them
310315
- **Join keys**: Use `repo_id` (integer) for cross-source joins, not repo names

notebooks/data/models/developers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def _(mo):
110110
def _(mo):
111111
mo.mermaid("""
112112
graph TD
113-
A[stg_opendevdata__developers<br/>ODD authors with GraphQL IDs] --> B[int_github__node_id_map<br/>Decode GraphQL → Database ID]
113+
A[stg_opendevdata__canonical_developers<br/>ODD authors with GraphQL IDs] --> B[int_github__node_id_map<br/>Decode GraphQL → Database ID]
114114
B --> D{Union + Deduplicate by user_id}
115115
C[int_gharchive__github_events<br/>GHA actors with Database IDs] --> D
116116
D --> E[int_ddp__developers<br/>Unified developer list]

notebooks/data/models/events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ def _(mo, pyoso_db_conn):
977977

978978

979979

980-
@app.cell
980+
@app.cell(hide_code=True)
981981
def setup_pyoso():
982982
# This code sets up pyoso to be used as a database provider for this notebook
983983
# This code is autogenerated. Modification could lead to unexpected results :)

notebooks/data/sources/github-archive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
app = marimo.App(width="full", css_file="../../styles/data.css")
55

66

7-
@app.cell
7+
@app.cell(hide_code=True)
88
def setup_pyoso():
99
# This code sets up pyoso to be used as a database provider for this notebook
1010
# This code is autogenerated. Modification could lead to unexpected results :)

notebooks/data/sources/open-dev-data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
app = marimo.App(width="full", css_file="../../styles/data.css")
55

66

7-
@app.cell
7+
@app.cell(hide_code=True)
88
def setup_pyoso():
99
# This code sets up pyoso to be used as a database provider for this notebook
1010
# This code is autogenerated. Modification could lead to unexpected results :)

notebooks/data/sources/oss-directory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
app = marimo.App(width="full", css_file="../../styles/data.css")
55

66

7-
@app.cell
7+
@app.cell(hide_code=True)
88
def setup_pyoso():
99
# This code sets up pyoso to be used as a database provider for this notebook
1010
# This code is autogenerated. Modification could lead to unexpected results :)

notebooks/insights/ethereum-repo-rank.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ def _(mo):
702702
# =============================================================================
703703

704704

705-
@app.cell
705+
@app.cell(hide_code=True)
706706
def _(mo, pyoso_db_conn):
707707
with mo.persistent_cache("panel_devs_v5"):
708708
df_panel_devs = mo.sql(
@@ -723,7 +723,7 @@ def _(mo, pyoso_db_conn):
723723
# =============================================================================
724724

725725

726-
@app.cell
726+
@app.cell(hide_code=True)
727727
def _(mo, pd, pyoso_db_conn):
728728
with mo.persistent_cache("engagement_unified_v1"):
729729
df_engagement_raw = mo.sql(
@@ -743,7 +743,7 @@ def _(mo, pd, pyoso_db_conn):
743743
return (df_engagement_raw,)
744744

745745

746-
@app.cell
746+
@app.cell(hide_code=True)
747747
def _(mo, pyoso_db_conn):
748748
with mo.persistent_cache("repo_engagement_v1"):
749749
df_repo_engagement = mo.sql(
@@ -765,7 +765,7 @@ def _(mo, pyoso_db_conn):
765765
return (df_repo_engagement,)
766766

767767

768-
@app.cell
768+
@app.cell(hide_code=True)
769769
def _(mo, pyoso_db_conn):
770770
with mo.persistent_cache("crossover_devs_v1"):
771771
df_crossover_devs = mo.sql(
@@ -789,7 +789,7 @@ def _(mo, pyoso_db_conn):
789789
# =============================================================================
790790

791791

792-
@app.cell
792+
@app.cell(hide_code=True)
793793
def _(df_repo_engagement, df_engagement_raw, eth_dev_set, pd, REPO_CATEGORIES, REPO_DESCRIPTIONS):
794794
df_trending = df_repo_engagement.copy()
795795
df_trending.rename(columns={"repo_lower": "repo_name"}, inplace=True)
@@ -841,7 +841,7 @@ def _(df_repo_engagement, df_engagement_raw, eth_dev_set, pd, REPO_CATEGORIES, R
841841
return (df_trending,)
842842

843843

844-
@app.cell
844+
@app.cell(hide_code=True)
845845
def _(df_panel_devs):
846846
eth_dev_set = set(df_panel_devs["username"].str.lower().tolist())
847847
return (eth_dev_set,)
@@ -852,7 +852,7 @@ def _(df_panel_devs):
852852
# =============================================================================
853853

854854

855-
@app.cell
855+
@app.cell(hide_code=True)
856856
def _(df_trending):
857857
df_signal_strength = df_trending.copy()
858858
df_signal_strength.rename(columns={
@@ -868,7 +868,7 @@ def _(df_trending):
868868
# =============================================================================
869869

870870

871-
@app.cell
871+
@app.cell(hide_code=True)
872872
def _(df_engagement_raw, df_trending, np, pd, REPO_CATEGORIES):
873873
_eth_repos = [k.lower() for k, v in REPO_CATEGORIES.items() if v == "Ethereum & Crypto"]
874874
_eth_in_data = df_trending[df_trending["repo_name"].isin(_eth_repos)].sort_values("eth_devs_30d", ascending=False).head(12)["repo_name"].tolist()
@@ -905,7 +905,7 @@ def _(df_engagement_raw, df_trending, np, pd, REPO_CATEGORIES):
905905
# =============================================================================
906906

907907

908-
@app.cell
908+
@app.cell(hide_code=True)
909909
def _(df_engagement_raw):
910910
_df = df_engagement_raw.copy()
911911
_df["day"] = _df["ts"].dt.floor("D")

0 commit comments

Comments
 (0)