Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,22 @@ Source: shipped package (`kumo.engine.pquery.predictive_query`)
Materialization is **explicit**. `fit` does not do it for you.

```python
snapshot = graph.snapshot()
import warnings

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Major · Maintainability & Code Quality · Quick win

Publish the updated skill references.

The Agent Skills pytest step fails because the published copy is stale. Run python3 agent-skills/scripts/publish_nvskills.py and commit the generated changes.

Source: Pipeline failures


# Kumo reports rows it dropped or could not link as warnings and keeps going
# (troubleshooting_signals.md §1a). Stop here, before any training, so the user decides first.
DATA_WARNINGS = ('duplicate primary-key', 'null or invalid primary key',
'invalid values found', 'non-null rows')
with warnings.catch_warnings(record=True) as caught:
warnings.simplefilter('always')
snapshot = graph.snapshot()
for w in caught:
print(f'{w.category.__name__}: {w.message}')
data_problems = [str(w.message) for w in caught
if any(s in str(w.message) for s in DATA_WARNINGS)]
if data_problems and not DATA_LOSS_ACCEPTED: # config cell; False unless the user chose

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Major · Data Integrity & Integration · Heavy lift

Bind acceptance to the snapshot the user reviewed.

If the user accepts one snapshot, DATA_LOSS_ACCEPTED remains true. A later snapshot with new data-loss warnings then proceeds without another decision. Bind acceptance to the reviewed snapshot and its warnings, and require a new decision when they change.

raise RuntimeError('Kumo reported a problem in the data; stopped before training:\n'
+ '\n'.join(data_problems))

training_table = pquery.generate_training_table(snapshot)
prediction_table = pquery.generate_prediction_table(
Expand All @@ -436,7 +451,13 @@ PredictiveQuery.generate_prediction_table(snapshot, *, prediction_time=None, pla
- `snapshot` is **positional** on both. `prediction_time` and `plan` are keyword-only on
`generate_prediction_table`.
- `graph.snapshot()` reads every table through its connector and builds an on-disk DiskGraph index
under the scratch directory. An unchanged valid snapshot is reused on later runs.
under the scratch directory. An unchanged valid snapshot is reused on later runs, and its data
warnings are raised again.
- **The snapshot cell stops on a data warning.** Repeated or missing primary keys, unparseable
values and unmatched foreign keys are warnings, not errors: without the stop the notebook trains
on what is left. `DATA_LOSS_ACCEPTED = False` goes in the config cell; it becomes `True` only
after the user has seen the messages and chosen to continue with the loss, never on the agent's
own initiative.
- `GraphSnapshot` exposes `.id`, `.index_path`, `.graph_config`.
- `TrainingTable` exposes `.train_table_path` (ordinary parquet), `.manifest_path`,
`.required_stages`, `.generation_plan`.
Expand Down Expand Up @@ -734,7 +755,7 @@ print('task type:', pquery.get_task_type())

# 5. Materialize. PREDICTION_TIME is NAIVE — a tz-aware datetime raises ValueError.
PREDICTION_TIME = datetime(2026, 8, 1)
snapshot = graph.snapshot()
snapshot = graph.snapshot() # wrapped in the §7 data-warning stop
training_table = pquery.generate_training_table(snapshot)
prediction_table = pquery.generate_prediction_table(
snapshot, prediction_time=PREDICTION_TIME, # NAIVE datetime, inside the event history
Expand Down Expand Up @@ -862,7 +883,8 @@ targets a superseded build and needs rewriting against §10 — do not copy its
- [ ] `with_column(...)` results assigned or chained — it returns a new Table.
- [ ] `Graph(tables=[...], edges=[Edge(...)])` — list form; `graph.validate()` emitted.
- [ ] `pquery.validate()` and `get_task_type()` run before training, both called with no arguments.
- [ ] `graph.snapshot()` before generating any table.
- [ ] `graph.snapshot()` before generating any table, inside the §7 data-warning stop, with
`DATA_LOSS_ACCEPTED = False` in the config cell.
- [ ] **`trainer.fit(training_table, snapshot=snapshot)`** — `snapshot=` present.
- [ ] **`trainer.predict(prediction_table, snapshot=snapshot, ...)`** — `snapshot=` present.
- [ ] `binary_classification_threshold` / `num_classes_to_return` on `predict`, never on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Observable symptom → likely cause → fix. Ordered by when the agent hits them
This file is the signal set as previously compiled. It is **not** re-verifiable against the published Kumo documentation, which is stale for this version of the local SDK and is not a source here — do not cite it, fetch it, or reconcile against it.

> No verbatim Kumo exception text is established for this SDK. Entries below are keyed on the **observable condition**, not on a quoted message. **Do not fabricate Kumo error strings.**
> The five messages quoted in §1a are the exceptions: they are the SDK's own text, read from its source.
> The six messages quoted in §1a are the exceptions: they are the SDK's own text, read from its source.

**Who applies a fix.** A fix that changes the data — casting a column, deduplicating, flattening,
filling or filtering values, combining columns into a key, normalising key types — is the user's
Expand Down Expand Up @@ -74,7 +74,7 @@ Fully specify tables in production code to avoid unexpected re-inference.
### Symptom: row count silently drops after ingestion
**Cause:** Duplicate primary key values — Kumo retains one row per key and drops the rest.
**Fix:** Report how many rows the key repeats on (the preflight probe, or the snapshot warning in
§1a) and put the choice to the user: a different, genuinely unique key, or the source deduplicated
§1a, which stops the notebook before training) and put the choice to the user: a different, genuinely unique key, or the source deduplicated
upstream. The agent does not deduplicate.

### Symptom: a categorical column has very high cardinality
Expand All @@ -98,13 +98,17 @@ change data, types or the query to make it go away (*Who applies a fix*, above).
|---|---|---|
| `Snapshot contains <n> duplicate primary-key row(s) for <table>.<key>` | `<n>` rows share a key; Kumo keeps one per key and drops the rest | a different key, or the source deduplicated; or continue knowing `<n>` rows are gone |
| `Foreign key <table>.<fk> matched <m> of <n> non-null rows` | only `<m>` of `<n>` rows reach the parent; the rest get no edge | the link may be wrong (wrong column, or values differing in format, e.g. `007` vs `7`), or the parent rows are missing |
| `Snapshot dropped <n> row(s) with a null or invalid primary key in <table>.<key>` | `<n>` rows have no usable key and are gone from the table | the source fixed upstream, or a different key; or continue knowing `<n>` rows are gone |
| `<n> invalid values found in <table>.<column>` | `<n>` values did not parse as the column's type and are read as null (see §5) | whether those rows are bad data, or the column's type is wrong |
| `key <table>.<column> has a floating-point dtype` | an ID column is stored as a float (often an integer key with nulls) | the column fixed upstream as an integer or string key |
| `foreign key <table>.<fk> (dtype=…) cannot link to primary key <table>.<pk> (dtype=…)` | the two sides of a link hold different types | which side is right, fixed upstream; never cast one side in the notebook |

A float or mismatched key fails `graph.validate()` and stops the notebook. The other three are
warnings: the notebook keeps going and trains on what is left. Either way, the report the user
reads starts with the message, the table and column, and the count.
A float or mismatched key fails `graph.validate()` and stops the notebook. The other four are
warnings: Kumo keeps going and trains on what is left, so the notebook's snapshot cell turns them
into a stop before training (`kumo_finetuning_sdk.md` §7). Either way, the report the user reads
starts with the message, then, per table, how many rows were lost or left unlinked and why —
repeated key, missing key, or a value (a time, a number) that did not parse — and asks before
anything trains.

---

Expand Down
Loading