fix: treat i2's NotSet signature default as no default - #4
Conversation
`get_root_values` ignores NotSet defaults (falls back on the annotation's default value or 0.0, as for a param with no default), and `_compute_node_value` no longer skips a missing NotSet-defaulted param as if it had a default. So a DAG built from signatures with NotSet defaults (as a re-landed i2mint/i2#88 FuncFactory would show) never seeds a widget with the sentinel. No-op for current signatures. Uses `i2.is_not_set` when available, else falls back on `i2.deco.NotSet`. Refs i2mint/i2#48 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Independent refute-review (sub-agent): dagapp itself is correct. The only places that read defaults are It also refuted my assumption that meshed needed no change. meshed sorted |
What
Step 2/3 of the re-land plan in i2mint/i2#48, for
dagapp: i2'sNotSetsentinel in a signature means "no default".get_root_values:NotSetdefaults are ignored, so the root gets the annotation'sDFLT_VALSentry or0.0, exactly as a param with no default does. Before, the sentinel itself became the widget's initial value._compute_node_value: a param missing from session state is only skipped (left to its default) if it has a real default (_has_default). ANotSetone behaves like a required param, as today.No-op against the current i2: no current signature carries
NotSet. There are no dependents in the fleet.i2 compatibility (decision)
Uses
i2.is_not_set(i2 >= 0.1.74, i2mint/i2#91) when available, otherwise falls back oni2.deco.NotSet(present since 2023). The i2 requirement is unchanged.Tests
dagapp/tests/test_not_set_defaults.py:get_root_valuesfor a DAG over aNotSet-defaulted function equals the plain one's, with no sentinel. Fails without the fix._has_default.Gate
pytest --doctest-modules dagapp(examples ignored), py3.12: 2 passed with i2 master and with i2 0.1.73 (fallback path). Master collects no tests.ruff check/ruff format --check: clean.🤖 Generated with Claude Code