jason810496 commented on code in PR #69400:
URL: https://github.com/apache/airflow/pull/69400#discussion_r3548214849


##########
ts-sdk/src/sdk/registry.ts:
##########
@@ -39,11 +42,15 @@ export class TaskRegistry {
    */
   register<TReturn = unknown>(registration: TaskRegistration, handler: 
TaskHandler<TReturn>): void {
     const { dagId, taskId } = registration;
-    if (!dagId || typeof dagId !== "string") {
-      throw new Error("dagId must be a non-empty string");
+    if (typeof dagId !== "string" || !KEY_REGEX.test(dagId)) {
+      throw new Error(
+        "dagId must be made of alphanumeric characters, dashes, dots, and 
underscores",
+      );
     }
-    if (!taskId || typeof taskId !== "string") {
-      throw new Error("taskId must be a non-empty string");
+    if (typeof taskId !== "string" || !KEY_REGEX.test(taskId)) {
+      throw new Error(
+        "taskId must be made of alphanumeric characters, dashes, dots, and 
underscores",
+      );

Review Comment:
   How about validating the `task_id` len as well?
   
   
https://github.com/apache/airflow/blob/dc5ddd26202f972f634a6ee9ce25f04f17669ad7/task-sdk/src/airflow/sdk/definitions/_internal/node.py#L37-L52



-- 
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