jason810496 commented on code in PR #67908:
URL: https://github.com/apache/airflow/pull/67908#discussion_r3471504700
##########
.pre-commit-config.yaml:
##########
@@ -239,6 +239,21 @@ repos:
^pyproject\.toml$
pass_filenames: false
require_serial: true
+ - id: ts-sdk-lint
Review Comment:
Could we make this `ts-sdk` directory only instead of having at root level?
##########
ts-sdk/src/client.ts:
##########
@@ -0,0 +1,88 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import type { ConnectionResult, GetXComOpts, SetXComOpts } from
"./client-types.js";
Review Comment:
Should we move all the modules under `ts-sdk/src` to `ts-sdk/src/sdk`?
Both Java and Go SDK follow this pattern, that the user-facing modules will
be located under `sdk` prefix to not mix the runtime internal with the user
interface.
https://github.com/apache/airflow/blob/c5059fe51e51c076b11dbd54be54a66b25c497bb/.agents/skills/airflow-java-sdk/SKILL.md#L33-L43
##########
ts-sdk/README.md:
##########
@@ -0,0 +1,137 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+# Airflow TypeScript SDK
+
+Public TypeScript interfaces for writing Apache Airflow task handlers.
+
+**Status:** alpha · API will change · Node 22+ · ESM-only
+
+This package defines the user-facing task handler contract: task registration,
+runtime context types, and the `TaskClient` interface used for Airflow
+Variables, Connections, and XCom. Runtime transports implement this interface
+separately.
+
+## Install
+
+```bash
+pnpm add @apache-airflow/ts-sdk
+```
+
+## Task Handlers
+
+```ts
+import { registerTask } from "@apache-airflow/ts-sdk";
+
+registerTask({ dagId: "example_dag", taskId: "say_hello" }, async ({ ctx,
client }) => {
Review Comment:
Having inline `registerTask` with DagId and TaskId makes sense for the 3.3
Multi-Language Dag scope.
However, from the further 3.4 going to the "defining whole Dag in Lang-SDK"
feature. Then how will the user interface looks like for the latter one?
Will the `registerTask` still compatible? Or do we need to another new
interface for it?
Since both Java and Go SDK went with two steps registration: 1. Define the
callable (function / class representing a task, which will support task level
args compatible ) 2. Register the Tasks with Dag relationship ( then we're able
to support Dag level args at this point)
Would like to learn more about your thoughts on the compatible user
interface to support both features. Thanks.
--
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]