jason810496 commented on code in PR #75392:
URL: https://github.com/apache/airflow/pull/75392#discussion_r4679528598
##########
ts-sdk/src/sdk/client.ts:
##########
@@ -84,16 +85,38 @@ export interface TaskClient {
* const data = await client.getXCom<{ count: number }>({ key: "result" });
* // data is { count: number } | null
* ```
+ *
+ * @throws `TypeError` when `key`, `dagId`, `taskId` or `runId` is not a
string, or `mapIndex` is not a number or `null`.
+ * @throws `RangeError` when `key`, `dagId`, `taskId` or `runId` is empty,
or `mapIndex` is not an integer.
*/
getXCom<T = unknown>(opts: GetXComOpts): Promise<T | null>;
/**
* Push an XCom value.
*
- * Target fields default to the current task's context.
+ * Target fields default to the current task's context; see
+ * {@link SetXComOpts} for how `mapIndex` defaults.
+ *
+ * @throws `TypeError` when `key`, `dagId`, `taskId` or `runId` is not a
string, or `mapIndex` is not a number or `null`.
+ * @throws `RangeError` when `key`, `dagId`, `taskId` or `runId` is empty,
or `mapIndex` is not an integer.
*/
setXCom(opts: SetXComOpts): Promise<void>;
+ /**
+ * Delete an XCom value.
+ *
+ * Target fields default to the current task's context; see
+ * {@link DeleteXComOpts} for how `mapIndex` defaults.
+ *
+ * Resolves whether or not anything was deleted. A key with no stored value
+ * and a target task that does not exist both succeed, so a resolved promise
+ * is not proof that an XCom was removed.
+ *
+ * @throws `TypeError` when `key` is not a string, or `mapIndex` is not a
number or `null`.
Review Comment:
Fixed in 4bbd344. The `@throws` lines now list `dagId`, `taskId` and `runId`
too.
##########
ts-sdk/src/sdk/client.ts:
##########
@@ -84,16 +85,38 @@ export interface TaskClient {
* const data = await client.getXCom<{ count: number }>({ key: "result" });
* // data is { count: number } | null
* ```
+ *
+ * @throws `TypeError` when `key`, `dagId`, `taskId` or `runId` is not a
string, or `mapIndex` is not a number or `null`.
+ * @throws `RangeError` when `key`, `dagId`, `taskId` or `runId` is empty,
or `mapIndex` is not an integer.
*/
getXCom<T = unknown>(opts: GetXComOpts): Promise<T | null>;
/**
* Push an XCom value.
*
- * Target fields default to the current task's context.
+ * Target fields default to the current task's context; see
+ * {@link SetXComOpts} for how `mapIndex` defaults.
+ *
+ * @throws `TypeError` when `key`, `dagId`, `taskId` or `runId` is not a
string, or `mapIndex` is not a number or `null`.
+ * @throws `RangeError` when `key`, `dagId`, `taskId` or `runId` is empty,
or `mapIndex` is not an integer.
*/
setXCom(opts: SetXComOpts): Promise<void>;
+ /**
+ * Delete an XCom value.
+ *
+ * Target fields default to the current task's context; see
+ * {@link DeleteXComOpts} for how `mapIndex` defaults.
+ *
+ * Resolves whether or not anything was deleted. A key with no stored value
+ * and a target task that does not exist both succeed, so a resolved promise
+ * is not proof that an XCom was removed.
+ *
+ * @throws `TypeError` when `key` is not a string, or `mapIndex` is not a
number or `null`.
+ * @throws `RangeError` when `key` is empty, or `mapIndex` is not an integer.
+ */
+ deleteXCom(opts: DeleteXComOpts): Promise<void>;
Review Comment:
Java adds it in #75393. Go only deletes internally before a retry, so task
code can't call it yet. Noted in the PR body.
--
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]