Add Python task conditional authoring (v0.1.8) - #49
Merged
Volv-G merged 3 commits intoAug 5, 2026
Merged
Conversation
Assisted-By: devx/e2f15aca-0551-44f2-9864-894c04d43eba
Assisted-By: devx/e2f15aca-0551-44f2-9864-894c04d43eba
Assisted-By: devx/e2f15aca-0551-44f2-9864-894c04d43eba
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
is_enabled=, serialized as canonicalTaskSpec.isEnabledGraphInputPlaceholder, andTaskOutputProxy; normalize Python booleans to lowercase"true"/"false"dynamicDataDynamicData,Raw, structured values, andNone) before writing outputexamples/python_pipeline/is_enabled_pipeline.pysample covering constant false, graph-input, and task-output conditionstangle-clifrom 0.1.7 to 0.1.8 across project metadata, runtime fallback, packaging expectations, and the lockfilePython authoring contract
Pipeline/component inputs are not specially marked as conditions. Declare an ordinary runtime graph input and pass its placeholder through the reserved task-call metadata keyword:
This emits task metadata, not a component argument:
Supported
is_enabled=values are:bool, normalized to the lowercase string"true"or"false"In[...]graph-input placeholdersis_enabled=gate.OutputIf a component itself declares an input named
is_enabled, bind that component argument separately with.bind(is_enabled=...); the bound value remains underarguments.is_enabled, while call-siteis_enabled=remains task metadata. Conditional execution is container-task-only:subpipeline(...)(is_enabled=...)is rejected with guidance, whilesubpipeline(...).bind(is_enabled=...)remains available for a child graph input collision.This intentionally does not add a
conditionalias.Validation
uv run pytest -q— 830 passed, 4 existingNamedTupledeprecation warningsgit diff --checkuv lock --checkuv run pytest -q tests/test_packaging.py— 10 passedtangle versionandtangle-cli versionboth reported0.1.8uv buildanduv build --package tangle-apiValid pipeline.