Skip to content

Milab 7197 add filtered inputs - #27

Merged
mchernys merged 4 commits into
mainfrom
MILAB-7197_add-filtered-inputs
Oct 22, 2026
Merged

mchernys merged 4 commits into
mainfrom
MILAB-7197_add-filtered-inputs

Conversation

@mchernys

@mchernys mchernys commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with a non-blocking gap in tests for subset runs.

Fix All in Claude CodeFindings

  1. P2 Subset runs lack tests ▶
Fix with agent prompt
### Issue 1
workflow/src/main.tpl.tengo:217-225
The new filtered workflow has no test that selects a subset. The existing idle smoke test never reaches this branch, so it cannot catch excluded entities leaking in or selected entities being dropped.

Add a small fixture with selected and excluded entities. Check output membership, a subset-only summary, and `pl7.app/inputSubset`. Include an entity missing a chain or region to cover the new full join.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds optional subset selection before sequence analysis. The latest change builds the graph frame directly to avoid duplicate property choices.

  • Sequence Properties can analyze only a selected subset of a dataset.
  • Graph views use block properties without adding their exports again.

Important touched types:

  • BlockParams: Settings supplied when creating a block. Adds optional filterRef.
  • BlockData: Saved inputs and view state. Stores the selected subset in filterRef.
  • BlockArgs: Values sent to the workflow. Adds inputFilter, the subset's encoded column ID.
  • DatasetOption: A dataset choice and its available filters. Now shapes inputOptions.
  • DatasetSelection: The dataset and filter selected in the UI. Now connects PlDatasetSelector to saved inputs.
  • PFrameHandle: A reference to columns available to graphs. The latest change creates it directly with ctx.createPFrame.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Dataset selection] --> B{Subset selected?}
  B -->|No| C[All input sequences]
  B -->|Yes| D[Sequences from selected entities]
  C --> E[Compute properties and summaries]
  D --> E
  E --> F[Table and graphs]
  E --> G[Published properties]
Loading

Reviews (2) · Last reviewed commit: "MILAB-7197: build the plot frame from ow..." · Reviewed by Greptile

Comment on lines +217 to +225
seqTb = pframes.tableBuilder("tsv").setJoinMode("full")
nSeqColumns := 0
addSeqColumn = func(column, opts) {
seqTb.addPrimary("col" + string(nSeqColumns), {
__isPrimaryRef: "v1",
column: column,
filter: filterColumn
}, opts)
nSeqColumns += 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Subset runs lack tests

The new filtered workflow has no test that selects a subset. The existing idle smoke test never reaches this branch, so it cannot catch excluded entities leaking in or selected entities being dropped.

Add a small fixture with selected and excluded entities. Check output membership, a subset-only summary, and pl7.app/inputSubset. Include an entity missing a chain or region to cover the new full join.

Prompt To Fix With AI
This is a comment left during a code review.
Path: workflow/src/main.tpl.tengo
Line: 217-225

Comment:
**Subset runs lack tests**

The new filtered workflow has no test that selects a subset. The existing idle smoke test never reaches this branch, so it cannot catch excluded entities leaking in or selected entities being dropped.

Add a small fixture with selected and excluded entities. Check output membership, a subset-only summary, and `pl7.app/inputSubset`. Include an entity missing a chain or region to cover the new full join.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

@mchernys

Copy link
Copy Markdown
Contributor Author

@greptileai

Comment thread model/src/index.ts Outdated
)
: [];
return createPFrameForGraphs(ctx, [...pCols, ...upstreamMeta]);
return ctx.createPFrame([...pCols, ...upstreamMeta]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're losing linkered columns (e.g. cluster size);
getAnchoredPColumns dosn't add them (createPFrameForGraphs did it); probably discovery api should be used here; Claude comment:

It can be done, and it's the better direction: getAnchoredPColumns is on the deprecation list in the pframes-api redesign. Everything needed is exported from @platforma-sdk/model 1.85, which the block uses:
ColumnsCollection, DataColumn, collectLinkerColumns, hitQualifications, extractPObjectId. The pattern to copy is graph-maker's discoverPFrameColumns
(core/visualizations/packages/graph-maker/src/utils/discoverPFrameColumns.ts:400-410). It isn't exported, and the block is on graph-maker 1.4.8 anyway, so it would be inlined:

const recipes = ColumnsCollection(["result_pool"], { ctx /* check form — see below */ })
.discover({ anchors: { main: anchorSpec }, mode: "enrichment", maxHops: 2 })
.getColumns();
for (const r of recipes) {
if (isOwnExport(r.getSpec())) continue; // same trace check as today
if (hitQualifications(r).length > 0) continue; // see caveat 2
add(materialize(r)); // DataColumn.fromId(extractPObjectId(r.id)).getData()
for (const l of collectLinkerColumns(r, { ctx })) add(materialize(l));
}
return ctx.createPFrame([...pCols, ...upstream]);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed; now commit f2d9a9c switches to the discoverPFrameColumns pattern.

@mchernys
mchernys added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit b20e6f7 Oct 22, 2026
13 checks passed
@mchernys
mchernys deleted the MILAB-7197_add-filtered-inputs branch October 22, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants