You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fa51011
Browse filesBrowse the repository at this point in the historyBrowse files
fix(provenance): exclude job tables, and never let source break an insert
Both from review of #1555.
Job tables were getting `_prov`. `is_entry_table` excluded the other tiers'
prefixes one at a time -- `_`, `#`, and `__` for parts -- and `~` was not among
them, so `~~analysis`, `~jobs` and `~lineage` all passed. The column really
landed and every job row carried a payload; on a large queue that is a lot of
JSON nobody asked for. It only surfaced after `jobs.refresh()` materialises the
table, which is why a plain populate() in the first round of tests missed it.
Now matched against `Manual.tier_regexp`. Enumerating what to exclude makes
every tier added later an Entry table until someone remembers this function;
matching the tier definition inverts that, so a name is an Entry table only if
the library says it is.
A `source` that json could not render broke every insert.
`config.provenance.source` is deployment-supplied and typed `dict[str, Any]`,
so a `date` in it raised `TypeError: Object of type date is not JSON
serializable` from inside every insert into every Entry table, naming neither
provenance nor the setting responsible. Three layers close it:
- `serialize` passes `default=str`, so ordinary values a deployment would
actually set -- dates, paths -- record correctly rather than failing;
- a validator on the field rejects what remains (non-string keys, cycles) at
assignment, where the error belongs;
- `_attach_provenance` catches and logs, so recording where a row came from can
never stop the row being written. That guarantee previously covered only the
version call.
Also fixes the `datajoint.migrate.add_prov_column` reference in the settings
description -- it lives in `deploy`, and that string shows up in config help.
Regression tests fail against the previous code: 4 of them, including the
integration one that drives a real job queue.
0 commit comments