docs(codelab): self-contained notebook — embed artifacts instead of downloading#273
Merged
caohy1988 merged 2 commits intoJun 2, 2026
Conversation
…download) Replace the curl-from-main artifact download with a single Python cell that writes table_ddl.sql / property_graph.sql / ontology.yaml / binding.yaml into the working directory. The cell renders in both the claat codelab and the Colab notebook, so the notebook now runs end-to-end with no external file fetch (and drops the unused seed_events.py download). A drift-guard test asserts the embedded copies stay byte-for-byte in sync with the canonical examples/codelab/periodic_materialization/ files, so the two sources can't silently diverge. Notebook regenerated; drift --check passes.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Item 2 of the codelab polish: make the Colab notebook self-contained. The "Get the Codelab Artifacts" step previously
curl-downloaded five files frommain; it now writes the four artifacts inline from a single Python cell, so the notebook runs end-to-end with no external fetch.curldownload (<!-- colab:skip -->bash +<!-- colab:cell python -->) with one<!-- colab:code python -->cell that writestable_ddl.sql,property_graph.sql,ontology.yaml,binding.yamlinto the working dir. It renders in both the claat codelab and the Colab notebook.seed_events.pydownload (seeding usesbqaa seed-events).${PROJECT_ID}/${DATASET}placeholders, so the existingenvsubstrender steps are unchanged.Drift guard
The embedded copies were generated from the canonical files (no hand-copy), and a new test —
tests/test_codelab_embedded_artifacts.py— asserts each embedded artifact stays byte-for-byte in sync withexamples/codelab/periodic_materialization/. So the "embed duplicates the source" risk is caught by CI; the two can't silently diverge.Test plan
tests/test_codelab_embedded_artifacts.py— 4 pass (embedded == canonical)--checkin sync; notebook has nocurlclaat exportsucceedsbash autoformat.shclean