aaron-y-chen opened a new pull request, #73357:
URL: https://github.com/apache/airflow/pull/73357

   ## Why
   
   The language SDK spec (`contributing-docs/30_new_language_sdk.rst`) makes 
`variable-read-write` a MUST: a task must be able to read, write and delete 
Airflow Variables. The TypeScript SDK could only read them. This is the 
TypeScript counterpart of #72676 (Java) and #73084 (Go).
   
   ## What
   
   - `src/sdk/client.ts`: `TaskClient` gains `setVariable(key, value, 
description?)` and `deleteVariable(key)`.
   - `src/coordinator/client.ts`: both send `PutVariable` / `DeleteVariable` to 
the supervisor. `description` is a required wire field, so it is always sent — 
`null` when the caller gives none, which is what Python's `Variable.set` stores 
by default.
   - `src/coordinator/client.ts`: each RPC now states whether a supervisor "row 
is absent" error means `null` or a failure. Only lookups can answer `null`; a 
call that resolves to `void` has no `null` for its caller to read, so a 
swallowed 404 would be indistinguishable from a write that landed. Deleting a 
missing key is the realistic case: the API server answers 404 and 
`deleteVariable` now rejects, as Python, Java and Go do. `setXCom` moves to the 
same policy.
   - `ts-sdk/capabilities.yaml` + README matrix: `variable-read-write` is now 
supported.
   - `example/`: a `write_and_delete_variable` task in `typescript_example` 
records the run id in a Variable, then writes and deletes a scratch Variable.
   - Docs: the `TaskClient` surface in `typescript.rst` and the README table.
   
   ## Verification
   
   `pnpm test` in `ts-sdk/` (316 passed) — PR CI does not run the vitest suite, 
only `lint` / `format` / `typecheck` via the `ts-sdk-lint` prek hook. The three 
new not-found tests fail when the per-operation policy is reverted.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes - Claude Code (Opus 5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to