feat(core): notebook cards for core resources #1260
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1260"
general
weight: 0.35
stefanv
What and why
Until now, a resource at the end of a notebook cell showed its dataclass
repr: one line, with nanosecond timestamps and nothing about related resources. Now, in Jupyter, VS Code and Colab, core resources display as HTML cards, similar to xarray's datasets:fetch_timeout. If one fails or doesn't load in time, its section says so and the rest of the card still displays. If building a card fails, the notebook shows the plainrepr./api/downloadAttachment/{rid}route, which uses the browser's sign-in. Signed out, the app asks you to sign in, then downloads the file.Attachment.get_contentsinstead uses a presigned URI that expires after two minutes, which would break links in a saved notebook.Cards exist for
NominalClient,Asset,Dataset,Run,Channel,DatasetFile,Event,Workbook,WorkbookTemplate,Checklist,Attachment,DataReview,WorkspaceandUser.VideoandVideoFileare deprecated, so they don't get one.set_display_optionsconfigures every card, as a call or awithblock, likexarray.set_options.get_display_optionsreturns the currentDisplayOptions:| Option | Default | Effect |
| --- | --- | --- |
|
style|"html"|"text"keeps the plainrepr||
timezone|"UTC"|"local"or an IANA name ||
time_format|"iso"|"readable":2026-11-02 09:52:57 MST||
time_precision|"s"|"ms","us"or"ns". Hovering shows the full value. ||
show_link|True| links to the Nominal app ||
fetch_details|True|False: no requests, only the object's own fields ||
collapse_threshold|10| sections with more items start collapsed ||
max_items|50| items listed and loaded per section ||
fetch_timeout|5.0| seconds a card waits, in total, for what it loads |A new example,
docs/src/examples/notebook_display.md, shows each card on a test rig with two datasets, three runs and an event.While testing the example in JupyterLab I found that the examples'
jupytext.tomlstripsextensionfrom notebook front matter. Without it, JupyterLab's Open With → Jupytext Notebook opened every example as one Markdown cell, which breaks the steps on the "Running the examples" page. The config now reads and saves.mdfiles there as MyST.A new
just notebookrecipe opensdocs/src/examples/in JupyterLab, with the client, thedocsgroup and Jupytext installed, so the examples can be run without a separate setup.Validation
tests/core/test_display.pycovers:- cards rendering with no requests when links and loading are off
- escaping of user values, and refusing non-http(s) links
- timestamp precision, time zone and format
- durations
- collapsing and cutting off long sections, and stopping a load past
max_items- load failures becoming a note in the section
- a slow section or workspace stopping at the card's time limit, and a card that fails to build falling back to the
repr- an asset's runs loading only as many pages as the card lists
- attachments listed by name, up to
max_items, each linked to its download- text style making no requests
- channel statistics combined from buckets, and from a single point
just test check,just check-format-notebooksand the docs extension tests pass.just build-docspasses and runs the example against a staging workspace.Review notes
DisplayOptions,get_display_optionsandset_display_optionsinnominal.core. In the reference docs they're filed under the client topic._display.fetchedcatchesException, so a failing related-resource request can't break the display. The error shows in the card.Channel._decimate_request.Channel._Clientsnow also declarescatalog, which every caller already passes, to read the dataset's time span.-
datasource_to_dataframe(channel_exact_match=[a, b])with two names returned no channels.- Passing
channels=dataset.get_channels(...)withoutlist()fails, because the helper reads the iterable twice.🤖 Generated with Claude Code