Skip to content

Declare the input port, naming the paths the Jinja templates ask for - #13

Merged
seebi merged 1 commit into
mainfrom
feature/declareInputPorts
Sep 16, 2026
Merged

seebi merged 1 commit into
mainfrom
feature/declareInputPorts

Conversation

@seebi

@seebi seebi commented Sep 16, 2026

Copy link
Copy Markdown
Member

Closes the last finding from the review of #12: the task declared no input_ports at all,
so what the workflow editor offered on the input side was DataIntegration's default rather
than anything the task stated.

What it declares now

One port when the query or the variables carry Jinja syntax — which is exactly when the
task reads its input — and no port at all otherwise, since a task without Jinja sends
its text once and ignores whatever is connected. A handle there only invites a connection
that does nothing.

The port names the paths, taken from the templates themselves with
jinja2.meta.find_undeclared_variables, the way cmem-plugin-llm derives an input schema
from its template variables. This is the part that matters: DataIntegration reads only the
paths a consuming task requests, so an unknown or flexible input asks for nothing and is
handed nothing.

A run that takes the per entity branch and receives nothing now warns in the execution
report, instead of reporting a successful run having sent no query at all. That was noted
as out of scope on the last ticket; it is also what made the investigation below possible,
since the warning is what reported how many input collections arrived.

What this does not fix

A dataset wired into this task still delivers zero entities, and the declaration is not
the reason. Verified against a deployment, five ways, all reporting Received 0 input
collection(s)
: no declaration, UnknownSchemaPort, FixedSchemaPort with the derived
paths, FlexibleSchemaPort, a freshly created workflow, and a distinctly versioned build
after a forced uninstall and reinstall.

What is established:

The source dataset yields entities yes — 2 rows, attribute id
The workflow wiring identical in shape to a transform reading a dataset in a workflow that works
Operator into this task input is delivered — chaining a second task in feeds the entity through
Dataset into this task nothing arrives, in every variation above

So the remaining suspect is the dataset to Python task schema negotiation, or something
about workflows created through the API rather than drawn in the editor. That wants either
a look from someone who knows the DataIntegration side, or a check of whether the editor
behaves differently — not another guess here.

Tests

Three new tests: the derived input schema names the template variables, a task without
Jinja declares no input, and a task with Jinja requests the paths it renders. task check
green — 38 offline, ruff, mypy, deptry, trivy.

🤖 Generated with Claude Code

The task declared no input ports at all, so what the editor offered was
DataIntegration's default rather than anything the task stated. It declares one
now, exactly when it reads one - when the query or the variables carry Jinja
syntax - and none otherwise, since a task without Jinja sends its text once and
ignores whatever is connected.

The port names the paths rather than leaving the schema unknown. DataIntegration
reads only the paths a consuming task requests, so an unknown or flexible input
asks for nothing and is handed nothing. The paths come from the templates
themselves, via jinja2.meta.find_undeclared_variables, which is how
cmem-plugin-llm derives its input schema from template variables.

A run that takes the per entity branch and receives nothing now says so in the
report. It used to report a successful run having sent no query at all, which is
also what made this diagnosable: the warning is what showed the task was handed
zero input collections.

This does not fix feeding the task from a dataset - see the report on the branch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Coverage

Coverage Report
File Stmts Miss Cover Missing
init.py 0 0 100%
workflow/init.py 0 0 100%
workflow/graphql.py 149 27 82% 242-243 273-275 277-278 280 289-294 316 323-325 328 346 355-360 416
workflow/utils.py 102 0 100%
TOTAL 251 27 89%  

Tests Skipped Failures Errors Time
50 13 💤 0 ❌ 0 🔥 3.151 ⏱

@seebi
seebi merged commit e5f7c1a into main Sep 16, 2026
2 checks passed
@seebi
seebi deleted the feature/declareInputPorts branch September 16, 2026 08: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.

1 participant